@jonloucks/badges-ts 0.1.1 → 1.0.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/api/Badge.d.ts +1 -1
- package/api/Badge.d.ts.map +1 -1
- package/api/Badge.js +1 -2
- package/api/BadgeException.js +8 -13
- package/api/BadgeException.js.map +1 -1
- package/api/BadgeFactory.d.ts +1 -1
- package/api/BadgeFactory.d.ts.map +1 -1
- package/api/BadgeFactory.js +5 -9
- package/api/BadgeFactory.js.map +1 -1
- package/api/Badges.js +1 -2
- package/api/Installer.js +1 -2
- package/api/Project.js +1 -2
- package/api/Types.js +4 -13
- package/api/Types.js.map +1 -1
- package/auxiliary/Checks.js +11 -20
- package/auxiliary/Checks.js.map +1 -1
- package/auxiliary/Command.js +1 -2
- package/auxiliary/DiscoverProject.js +5 -9
- package/auxiliary/DiscoverProject.js.map +1 -1
- package/cli.d.ts +3 -2
- package/cli.d.ts.map +1 -1
- package/cli.js +23 -33
- package/cli.js.map +1 -1
- package/data/Resolver.d.ts +10 -0
- package/data/Resolver.d.ts.map +1 -0
- package/data/Resolver.js +13 -0
- package/data/Resolver.js.map +1 -0
- package/impl/BadgeFactory.impl.js +6 -9
- package/impl/BadgeFactory.impl.js.map +1 -1
- package/impl/Command.impl.js +1 -4
- package/impl/Command.impl.js.map +1 -1
- package/impl/DiscoverProject.impl.js +13 -16
- package/impl/DiscoverProject.impl.js.map +1 -1
- package/impl/Installer.impl.d.ts.map +1 -1
- package/impl/Installer.impl.js +11 -14
- package/impl/Installer.impl.js.map +1 -1
- package/impl/Internal.impl.d.ts +7 -2
- package/impl/Internal.impl.d.ts.map +1 -1
- package/impl/Internal.impl.js +40 -9
- package/impl/Internal.impl.js.map +1 -1
- package/impl/apply-version-command.d.ts.map +1 -1
- package/impl/apply-version-command.js +19 -21
- package/impl/apply-version-command.js.map +1 -1
- package/impl/discover-command.js +4 -7
- package/impl/discover-command.js.map +1 -1
- package/impl/generate-command.d.ts +1 -1
- package/impl/generate-command.d.ts.map +1 -1
- package/impl/generate-command.js +96 -60
- package/impl/generate-command.js.map +1 -1
- package/index.d.ts +6 -7
- package/index.d.ts.map +1 -1
- package/index.js +4 -9
- package/index.js.map +1 -1
- package/package.json +18 -13
- package/version.js +2 -5
- package/version.js.map +1 -1
package/api/Badge.d.ts
CHANGED
package/api/Badge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/api/Badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../src/api/Badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAEhE,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/api/Badge.js
CHANGED
package/api/BadgeException.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.guard = guard;
|
|
5
|
-
const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
6
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
7
|
-
const Checks_2 = require("@jonloucks/badges-ts/auxiliary/Checks");
|
|
1
|
+
import { messageCheck } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
2
|
+
import { isNotPresent } from "@jonloucks/contracts-ts/api/Types";
|
|
3
|
+
import { used } from "@jonloucks/badges-ts/auxiliary/Checks";
|
|
8
4
|
/**
|
|
9
5
|
* Runtime exception thrown for Badge related problems.
|
|
10
6
|
*/
|
|
11
|
-
class BadgeException extends Error {
|
|
7
|
+
export class BadgeException extends Error {
|
|
12
8
|
/**
|
|
13
9
|
* Passthrough for {@link Error(String, Throwable)}
|
|
14
10
|
*
|
|
@@ -17,8 +13,8 @@ class BadgeException extends Error {
|
|
|
17
13
|
*/
|
|
18
14
|
constructor(message, thrown = null) {
|
|
19
15
|
// super(messageCheck(message), thrown || undefined);
|
|
20
|
-
super(
|
|
21
|
-
|
|
16
|
+
super(messageCheck(message));
|
|
17
|
+
used(thrown);
|
|
22
18
|
this.name = "BadgeException";
|
|
23
19
|
Object.setPrototypeOf(this, BadgeException.prototype);
|
|
24
20
|
}
|
|
@@ -28,7 +24,7 @@ class BadgeException extends Error {
|
|
|
28
24
|
* @param message the optional message to use if caught is not an BadgeException
|
|
29
25
|
*/
|
|
30
26
|
static rethrow(caught, message) {
|
|
31
|
-
if (
|
|
27
|
+
if (isNotPresent(caught)) {
|
|
32
28
|
this.throwUnknown(message);
|
|
33
29
|
}
|
|
34
30
|
else if (guard(caught)) {
|
|
@@ -45,14 +41,13 @@ class BadgeException extends Error {
|
|
|
45
41
|
throw new BadgeException(message ?? "Unknown type of caught value.");
|
|
46
42
|
}
|
|
47
43
|
}
|
|
48
|
-
exports.BadgeException = BadgeException;
|
|
49
44
|
/**
|
|
50
45
|
* Determine if an instance is a BadgeException
|
|
51
46
|
*
|
|
52
47
|
* @param instance the instance to check
|
|
53
48
|
* @returns true if the instance is a BadgeException
|
|
54
49
|
*/
|
|
55
|
-
function guard(instance) {
|
|
50
|
+
export function guard(instance) {
|
|
56
51
|
return instance instanceof BadgeException;
|
|
57
52
|
}
|
|
58
53
|
//# sourceMappingURL=BadgeException.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeException.js","sourceRoot":"","sources":["../../src/api/BadgeException.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeException.js","sourceRoot":"","sources":["../../src/api/BadgeException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAEvC;;;;;OAKG;IACH,YAAmB,OAAe,EAAE,SAAuB,IAAI;QAC7D,qDAAqD;QACrD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7B,IAAI,CAAC,MAAM,CAAC,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;IACvD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,MAAe,EAAE,OAAgB;QAC9C,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,MAAM,MAAM,CAAC;QACf,CAAC;aAAM,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;YACnC,MAAM,IAAI,cAAc,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACL,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,YAAY,CAAE,OAAgB;QAC3C,MAAM,IAAI,cAAc,CAAC,OAAO,IAAI,+BAA+B,CAAC,CAAC;IACvE,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,QAAiB;IACrC,OAAO,QAAQ,YAAY,cAAc,CAAC;AAC5C,CAAC"}
|
package/api/BadgeFactory.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Badge, Config as BadgeConfig } from "@jonloucks/badges-ts/api/Badge";
|
|
2
|
-
import { RequiredType } from "
|
|
2
|
+
import { RequiredType } from "@jonloucks/badges-ts/api/Types";
|
|
3
3
|
import { Contract } from "@jonloucks/contracts-ts";
|
|
4
4
|
/**
|
|
5
5
|
* Interface for creating badges based on a configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeFactory.d.ts","sourceRoot":"","sources":["../../src/api/BadgeFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAkB,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"BadgeFactory.d.ts","sourceRoot":"","sources":["../../src/api/BadgeFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAkB,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAkB,MAAM,yBAAyB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAE3B;;;;OAIG;IACH,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAClD;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,YAAY,CAAC,CAE/E;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAG1C,CAAC"}
|
package/api/BadgeFactory.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.CONTRACT = void 0;
|
|
4
|
-
exports.guard = guard;
|
|
5
|
-
const Types_1 = require("./Types");
|
|
6
|
-
const contracts_ts_1 = require("@jonloucks/contracts-ts");
|
|
1
|
+
import { guardFunctions } from "@jonloucks/badges-ts/api/Types";
|
|
2
|
+
import { createContract } from "@jonloucks/contracts-ts";
|
|
7
3
|
/**
|
|
8
4
|
* Determine if an instance implements BadgeFactory
|
|
9
5
|
*
|
|
10
6
|
* @param instance the instance to check
|
|
11
7
|
* @returns true if the instance implements BadgeFactory
|
|
12
8
|
*/
|
|
13
|
-
function guard(instance) {
|
|
14
|
-
return
|
|
9
|
+
export function guard(instance) {
|
|
10
|
+
return guardFunctions(instance, 'createBadge');
|
|
15
11
|
}
|
|
16
12
|
/**
|
|
17
13
|
* The BadgeFactory contract
|
|
18
14
|
*/
|
|
19
|
-
|
|
15
|
+
export const CONTRACT = createContract({
|
|
20
16
|
name: "BadgeFactory",
|
|
21
17
|
test: guard
|
|
22
18
|
});
|
package/api/BadgeFactory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeFactory.js","sourceRoot":"","sources":["../../src/api/BadgeFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeFactory.js","sourceRoot":"","sources":["../../src/api/BadgeFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAgB,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAY,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAiBnE;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,QAAiB;IACrC,OAAO,cAAc,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA2B,cAAc,CAAC;IAC7D,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,KAAK;CACZ,CAAC,CAAC"}
|
package/api/Badges.js
CHANGED
package/api/Installer.js
CHANGED
package/api/Project.js
CHANGED
package/api/Types.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAX_TIMEOUT = exports.MIN_TIMEOUT = exports.isString = exports.isPresent = exports.isNumber = exports.isNotPresent = exports.guardFunctions = void 0;
|
|
4
|
-
exports.isThrowable = isThrowable;
|
|
5
|
-
var Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
6
|
-
Object.defineProperty(exports, "guardFunctions", { enumerable: true, get: function () { return Types_1.guardFunctions; } });
|
|
7
|
-
Object.defineProperty(exports, "isNotPresent", { enumerable: true, get: function () { return Types_1.isNotPresent; } });
|
|
8
|
-
Object.defineProperty(exports, "isNumber", { enumerable: true, get: function () { return Types_1.isNumber; } });
|
|
9
|
-
Object.defineProperty(exports, "isPresent", { enumerable: true, get: function () { return Types_1.isPresent; } });
|
|
10
|
-
Object.defineProperty(exports, "isString", { enumerable: true, get: function () { return Types_1.isString; } });
|
|
1
|
+
export { guardFunctions, isNotPresent, isNumber, isPresent, isString } from "@jonloucks/contracts-ts/api/Types";
|
|
11
2
|
/**
|
|
12
3
|
* Type guard to determine if a value is Throwable
|
|
13
4
|
*
|
|
14
5
|
* @param value the value to check
|
|
15
6
|
* @return true if the value is Throwable
|
|
16
7
|
*/
|
|
17
|
-
function isThrowable(value) { return true; }
|
|
8
|
+
export function isThrowable(value) { return true; }
|
|
18
9
|
/**
|
|
19
10
|
* The minimum timeout duration
|
|
20
11
|
*/
|
|
21
|
-
|
|
12
|
+
export const MIN_TIMEOUT = {
|
|
22
13
|
get milliSeconds() {
|
|
23
14
|
return 0;
|
|
24
15
|
}
|
|
@@ -26,7 +17,7 @@ exports.MIN_TIMEOUT = {
|
|
|
26
17
|
/**
|
|
27
18
|
* The maximum timeout duration
|
|
28
19
|
*/
|
|
29
|
-
|
|
20
|
+
export const MAX_TIMEOUT = {
|
|
30
21
|
get milliSeconds() {
|
|
31
22
|
return Number.MAX_SAFE_INTEGER;
|
|
32
23
|
}
|
package/api/Types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Types.js","sourceRoot":"","sources":["../../src/api/Types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAQhH;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAI,KAAc,IAA2B,OAAO,IAAI,CAAC,CAAC,CAAC;AAQtF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,IAAI,YAAY;QACd,OAAO,CAAC,CAAC;IACX,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAa;IACnC,IAAI,YAAY;QACd,OAAO,MAAM,CAAC,gBAAgB,CAAC;IACjC,CAAC;CACF,CAAC"}
|
package/auxiliary/Checks.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.isNonEmptyString = isNonEmptyString;
|
|
6
|
-
exports.fileDoesNotExist = fileDoesNotExist;
|
|
7
|
-
const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
8
|
-
Object.defineProperty(exports, "illegalCheck", { enumerable: true, get: function () { return Checks_1.illegalCheck; } });
|
|
9
|
-
Object.defineProperty(exports, "presentCheck", { enumerable: true, get: function () { return Checks_1.presentCheck; } });
|
|
10
|
-
Object.defineProperty(exports, "configCheck", { enumerable: true, get: function () { return Checks_1.configCheck; } });
|
|
11
|
-
Object.defineProperty(exports, "used", { enumerable: true, get: function () { return Checks_1.used; } });
|
|
12
|
-
const Types_1 = require("@jonloucks/badges-ts/api/Types");
|
|
13
|
-
const fs_1 = require("fs");
|
|
1
|
+
import { illegalCheck, presentCheck, configCheck, used } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
2
|
+
import { MAX_TIMEOUT } from "@jonloucks/badges-ts/api/Types";
|
|
3
|
+
import { existsSync } from "fs";
|
|
4
|
+
export { presentCheck, illegalCheck, configCheck, used };
|
|
14
5
|
/**
|
|
15
6
|
* Check that a timeout is valid
|
|
16
7
|
*
|
|
@@ -18,10 +9,10 @@ const fs_1 = require("fs");
|
|
|
18
9
|
* @return the timeout if valid
|
|
19
10
|
* @throws IllegalArgumentException if the timeout is not valid
|
|
20
11
|
*/
|
|
21
|
-
function timeoutCheck(timeout) {
|
|
22
|
-
const presentTimeout =
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
export function timeoutCheck(timeout) {
|
|
13
|
+
const presentTimeout = presentCheck(timeout, "Timeout must be present.");
|
|
14
|
+
illegalCheck(timeout, presentTimeout.milliSeconds < 0, "Timeout must not be negative.");
|
|
15
|
+
illegalCheck(timeout, presentTimeout.milliSeconds > MAX_TIMEOUT.milliSeconds, "Timeout must be less than or equal to maximum time.");
|
|
25
16
|
return presentTimeout;
|
|
26
17
|
}
|
|
27
18
|
/**
|
|
@@ -30,7 +21,7 @@ function timeoutCheck(timeout) {
|
|
|
30
21
|
* @param value the value to check
|
|
31
22
|
* @return true if the value is a non-empty string, false otherwise
|
|
32
23
|
*/
|
|
33
|
-
function isNonEmptyString(value) {
|
|
24
|
+
export function isNonEmptyString(value) {
|
|
34
25
|
return typeof value === "string" && value.trim().length > 0;
|
|
35
26
|
}
|
|
36
27
|
/**
|
|
@@ -39,7 +30,7 @@ function isNonEmptyString(value) {
|
|
|
39
30
|
* @param path the file path to check
|
|
40
31
|
* @return true if the file does not exist, false otherwise
|
|
41
32
|
*/
|
|
42
|
-
function fileDoesNotExist(path) {
|
|
43
|
-
return !
|
|
33
|
+
export function fileDoesNotExist(path) {
|
|
34
|
+
return !existsSync(presentCheck(path, "Path must be present."));
|
|
44
35
|
}
|
|
45
36
|
//# sourceMappingURL=Checks.js.map
|
package/auxiliary/Checks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checks.js","sourceRoot":"","sources":["../../src/auxiliary/Checks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checks.js","sourceRoot":"","sources":["../../src/auxiliary/Checks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAEzG,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAwC,CAAC;AAE/F;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,OAA+B;IAC1D,MAAM,cAAc,GAA4B,YAAY,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;IAClG,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,YAAY,GAAG,CAAC,EAAE,+BAA+B,CAAC,CAAC;IACxF,YAAY,CAAC,OAAO,EAAE,cAAc,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,EAAE,qDAAqD,CAAC,CAAC;IACrI,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
package/auxiliary/Command.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.CONTRACT = void 0;
|
|
4
|
-
exports.guard = guard;
|
|
5
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
6
|
-
const contracts_ts_1 = require("@jonloucks/contracts-ts");
|
|
1
|
+
import { guardFunctions } from "@jonloucks/contracts-ts/api/Types";
|
|
2
|
+
import { createContract } from "@jonloucks/contracts-ts";
|
|
7
3
|
/**
|
|
8
4
|
* Determine if an instance implements DiscoverProject
|
|
9
5
|
*
|
|
10
6
|
* @param instance the instance to check
|
|
11
7
|
* @returns true if the instance implements DiscoverProject
|
|
12
8
|
*/
|
|
13
|
-
function guard(instance) {
|
|
14
|
-
return
|
|
9
|
+
export function guard(instance) {
|
|
10
|
+
return guardFunctions(instance, 'discoverProject');
|
|
15
11
|
}
|
|
16
12
|
/**
|
|
17
13
|
* The DiscoverProject contract
|
|
18
14
|
*/
|
|
19
|
-
|
|
15
|
+
export const CONTRACT = createContract({
|
|
20
16
|
name: "DiscoverProject",
|
|
21
17
|
test: guard
|
|
22
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscoverProject.js","sourceRoot":"","sources":["../../src/auxiliary/DiscoverProject.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiscoverProject.js","sourceRoot":"","sources":["../../src/auxiliary/DiscoverProject.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAY,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAenE;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,QAAiB;IACrC,OAAO,cAAc,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA8B,cAAc,CAAC;IAChE,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,KAAK;CACZ,CAAC,CAAC"}
|
package/cli.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { type Context } from "@jonloucks/badges-ts/auxiliary/Command";
|
|
2
3
|
/**
|
|
3
4
|
* Main entry point for the Badges CLI application.
|
|
4
5
|
* This function is responsible for parsing command-line arguments,
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
* @param args - The command-line arguments passed to the CLI, typically from process.argv.slice(2).
|
|
9
10
|
* @returns A promise that resolves when the command execution is complete.
|
|
10
11
|
* @throws An error if command execution fails or if no valid command is found.
|
|
12
|
+
*
|
|
11
13
|
*/
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function runMain(): Promise<void>;
|
|
14
|
+
export declare function runMain(context: Context): Promise<void>;
|
|
14
15
|
//# sourceMappingURL=cli.d.ts.map
|
package/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAMA,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,wCAAwC,CAAC;AASpF;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAY7D"}
|
package/cli.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
2
|
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
4
3
|
if (value !== null && value !== void 0) {
|
|
5
4
|
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
@@ -52,17 +51,15 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
52
51
|
var e = new Error(message);
|
|
53
52
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
54
53
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
65
|
-
const Command_impl_1 = require("./impl/Command.impl");
|
|
54
|
+
import { COMMAND as APPLY_VERSION_COMMAND } from "./impl/apply-version-command.js";
|
|
55
|
+
import { COMMAND as DISCOVER_COMMAND } from "./impl/discover-command.js";
|
|
56
|
+
import { COMMAND as GENERATE_COMMAND } from "./impl/generate-command.js";
|
|
57
|
+
import { createInstaller } from "@jonloucks/badges-ts";
|
|
58
|
+
import { isNotPresent, isPresent } from '@jonloucks/contracts-ts/api/Types';
|
|
59
|
+
import { used } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
60
|
+
import { toContext } from "./impl/Command.impl.js";
|
|
61
|
+
import { Internal } from './impl/Internal.impl.js';
|
|
62
|
+
import { VERSION } from "./version.js";
|
|
66
63
|
/**
|
|
67
64
|
* Main entry point for the Badges CLI application.
|
|
68
65
|
* This function is responsible for parsing command-line arguments,
|
|
@@ -72,15 +69,15 @@ const Command_impl_1 = require("./impl/Command.impl");
|
|
|
72
69
|
* @param args - The command-line arguments passed to the CLI, typically from process.argv.slice(2).
|
|
73
70
|
* @returns A promise that resolves when the command execution is complete.
|
|
74
71
|
* @throws An error if command execution fails or if no valid command is found.
|
|
72
|
+
*
|
|
75
73
|
*/
|
|
76
|
-
async function
|
|
74
|
+
export async function runMain(context) {
|
|
77
75
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
78
76
|
try {
|
|
79
|
-
const usingInstaller = __addDisposableResource(env_1,
|
|
80
|
-
|
|
81
|
-
const context = (0, Command_impl_1.toContext)(args);
|
|
77
|
+
const usingInstaller = __addDisposableResource(env_1, createInstaller().open(), false);
|
|
78
|
+
used(usingInstaller);
|
|
82
79
|
const command = findCommand(context);
|
|
83
|
-
if (
|
|
80
|
+
if (isPresent(command)) {
|
|
84
81
|
await command.execute(context);
|
|
85
82
|
}
|
|
86
83
|
else {
|
|
@@ -101,25 +98,24 @@ function findCommand(context) {
|
|
|
101
98
|
return undefined;
|
|
102
99
|
}
|
|
103
100
|
const firstNonFlag = findFirstCommand(context.arguments);
|
|
104
|
-
if (
|
|
101
|
+
if (isNotPresent(firstNonFlag)) {
|
|
105
102
|
return undefined;
|
|
106
103
|
}
|
|
107
104
|
switch (firstNonFlag.trim().toLowerCase()) {
|
|
108
105
|
case 'discover': {
|
|
109
|
-
return
|
|
106
|
+
return DISCOVER_COMMAND;
|
|
110
107
|
}
|
|
111
|
-
case 'generate':
|
|
112
|
-
|
|
113
|
-
return generate_command_1.COMMAND;
|
|
108
|
+
case 'generate': {
|
|
109
|
+
return GENERATE_COMMAND;
|
|
114
110
|
}
|
|
115
111
|
case 'apply-version': {
|
|
116
|
-
return
|
|
112
|
+
return APPLY_VERSION_COMMAND;
|
|
117
113
|
}
|
|
118
114
|
case 'version': {
|
|
119
115
|
return {
|
|
120
116
|
execute: async (context) => {
|
|
121
117
|
printBanner(context);
|
|
122
|
-
return
|
|
118
|
+
return VERSION;
|
|
123
119
|
}
|
|
124
120
|
};
|
|
125
121
|
}
|
|
@@ -135,14 +131,13 @@ function findCommand(context) {
|
|
|
135
131
|
}
|
|
136
132
|
}
|
|
137
133
|
function printBanner(context) {
|
|
138
|
-
context.display.info(`Badges-TS CLI - Version ${
|
|
134
|
+
context.display.info(`Badges-TS CLI - Version ${VERSION}`);
|
|
139
135
|
}
|
|
140
136
|
function printUsage(context) {
|
|
141
137
|
printBanner(context);
|
|
142
138
|
context.display.info(`Usage:`);
|
|
143
139
|
context.display.info(` badges-ts discover Detect project information from the current directory`);
|
|
144
140
|
context.display.info(` badges-ts generate Generate badges for the current project`);
|
|
145
|
-
context.display.info(` badges-ts generate-badges (deprecated) Alias for "generate"`);
|
|
146
141
|
context.display.info(` badges-ts apply-version Apply version badges to the current project`);
|
|
147
142
|
}
|
|
148
143
|
function findFirstCommand(args) {
|
|
@@ -155,12 +150,7 @@ function findFirstCommand(args) {
|
|
|
155
150
|
}
|
|
156
151
|
return args.find(arg => !arg.startsWith('-'));
|
|
157
152
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
/* istanbul ignore next */
|
|
162
|
-
// Only run main if the file is executed directly
|
|
163
|
-
if (require.main === module) {
|
|
164
|
-
runMain();
|
|
153
|
+
if (Internal.isRunning(import.meta.url)) {
|
|
154
|
+
await runMain(toContext(process.argv.slice(2)));
|
|
165
155
|
}
|
|
166
156
|
//# sourceMappingURL=cli.js.map
|
package/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,0CAA0C,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;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CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a path relative to the src/data directory.
|
|
3
|
+
* This is used to access data files that are part of the package, such as badge templates.
|
|
4
|
+
* This avoids issues with relative paths when the package is installed in different locations or when the current working directory is not the project root.
|
|
5
|
+
* and avoids path vulnerabilities using relative paths from the current working directory.
|
|
6
|
+
* @param segments - The path segments to join.
|
|
7
|
+
* @returns The resolved path.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveDataPath(...segments: string[]): string;
|
|
10
|
+
//# sourceMappingURL=Resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resolver.d.ts","sourceRoot":"","sources":["../../src/data/Resolver.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7D"}
|
package/data/Resolver.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { join } from "path";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a path relative to the src/data directory.
|
|
4
|
+
* This is used to access data files that are part of the package, such as badge templates.
|
|
5
|
+
* This avoids issues with relative paths when the package is installed in different locations or when the current working directory is not the project root.
|
|
6
|
+
* and avoids path vulnerabilities using relative paths from the current working directory.
|
|
7
|
+
* @param segments - The path segments to join.
|
|
8
|
+
* @returns The resolved path.
|
|
9
|
+
*/
|
|
10
|
+
export function resolveDataPath(...segments) {
|
|
11
|
+
return join(import.meta.dirname, ...segments);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resolver.js","sourceRoot":"","sources":["../../src/data/Resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,GAAG,QAAkB;IACnD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.create = create;
|
|
4
|
-
const Checks_1 = require("@jonloucks/badges-ts/auxiliary/Checks");
|
|
5
|
-
const fs_1 = require("fs");
|
|
1
|
+
import { presentCheck } from "@jonloucks/badges-ts/auxiliary/Checks";
|
|
2
|
+
import { readFile, writeFile } from "fs";
|
|
6
3
|
/**
|
|
7
4
|
* Factory for creating badges based on templates and provided data.
|
|
8
5
|
* The factory reads a badge template file, replaces placeholders with actual values,
|
|
@@ -26,13 +23,13 @@ const fs_1 = require("fs");
|
|
|
26
23
|
* console.log(`Badge created at ${badge.outputPath}`);
|
|
27
24
|
* ```
|
|
28
25
|
*/
|
|
29
|
-
function create() {
|
|
26
|
+
export function create() {
|
|
30
27
|
return BadgeFactoryImpl.internalCreate();
|
|
31
28
|
}
|
|
32
29
|
// ---- Implementation details below ----
|
|
33
30
|
class BadgeFactoryImpl {
|
|
34
31
|
async createBadge(config) {
|
|
35
|
-
const templatePath =
|
|
32
|
+
const templatePath = presentCheck(config.templatePath, "Badge template path is required for badge generation.");
|
|
36
33
|
const data = await readDataFile(templatePath);
|
|
37
34
|
const generated = replaceKeywords(config, data.toString('utf8'));
|
|
38
35
|
if (config.flags.dryRun) {
|
|
@@ -61,7 +58,7 @@ class BadgeFactoryImpl {
|
|
|
61
58
|
}
|
|
62
59
|
async function readDataFile(filePath) {
|
|
63
60
|
return new Promise((resolve, reject) => {
|
|
64
|
-
|
|
61
|
+
readFile(filePath, (err, data) => {
|
|
65
62
|
if (err) {
|
|
66
63
|
reject(err);
|
|
67
64
|
}
|
|
@@ -73,7 +70,7 @@ async function readDataFile(filePath) {
|
|
|
73
70
|
}
|
|
74
71
|
async function writeDataFile(filePath, data) {
|
|
75
72
|
return new Promise((resolve, reject) => {
|
|
76
|
-
|
|
73
|
+
writeFile(filePath, data, (err) => {
|
|
77
74
|
if (err) {
|
|
78
75
|
reject(err);
|
|
79
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeFactory.impl.js","sourceRoot":"","sources":["../../src/impl/BadgeFactory.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeFactory.impl.js","sourceRoot":"","sources":["../../src/impl/BadgeFactory.impl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,gBAAgB,CAAC,cAAc,EAAE,CAAC;AAC3C,CAAC;AAED,yCAAyC;AAEzC,MAAM,gBAAgB;IAEpB,KAAK,CAAC,WAAW,CAAC,MAAmB;QACnC,MAAM,YAAY,GAAW,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,uDAAuD,CAAC,CAAC;QACxH,MAAM,IAAI,GAAW,MAAM,YAAY,CAAC,YAAY,CAAC,CAAC;QACtD,MAAM,SAAS,GAAW,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;QAEzE,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YACrE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC9B,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,UAAU,EAAE,MAAM,CAAC,UAAU;aAC9B,CAAC;QAC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,CAAC,KAAK;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;IACF,uEAAuE;IACvE,MAAM,gBAAgB,GAAW,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;QACrF,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAA+B,CAAC;QAC3D,yDAAyD;QACzD,OAAO,YAAY,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3F,CAAC,CAAC,CAAA;IACF,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
package/impl/Command.impl.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toContext = toContext;
|
|
4
|
-
function toContext(args) {
|
|
1
|
+
export function toContext(args) {
|
|
5
2
|
const flags = parseFlags({ args });
|
|
6
3
|
const display = flagsToDisplay(flags);
|
|
7
4
|
return {
|
package/impl/Command.impl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.impl.js","sourceRoot":"","sources":["../../src/impl/Command.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Command.impl.js","sourceRoot":"","sources":["../../src/impl/Command.impl.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,MAAM,KAAK,GAAU,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAY,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,OAAO;QACL,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,KAAK;KACb,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,IAAI,EAAuB;IAC/C,OAA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