@skuba-lib/api 2.0.0 → 2.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/lib/buildkite/index.cjs +2 -2
- package/lib/buildkite/index.mjs +2 -2
- package/lib/{buildkite-DYEmlPsk.mjs → buildkite-DQj9dGPb.mjs} +2 -2
- package/lib/{buildkite-LAIGLOBs.cjs → buildkite-Oza5ZHmO.cjs} +2 -2
- package/lib/error-DnkB3E6d.mjs +48 -0
- package/lib/error-DwxMLko3.cjs +133 -0
- package/lib/{exec-DlNU-Xkx.mjs → exec-5nrAPCdO.mjs} +1 -1
- package/lib/{exec-Bw40ID4u.cjs → exec-BYbHipiC.cjs} +1 -1
- package/lib/git/index.cjs +1 -1
- package/lib/git/index.mjs +1 -1
- package/lib/{git-DpIxcywT.cjs → git-B2_B1F3q.cjs} +1 -1
- package/lib/{git-BXsbRhLT.mjs → git-QhXK6ooP.mjs} +1 -1
- package/lib/github/index.cjs +2 -2
- package/lib/github/index.mjs +2 -2
- package/lib/{github-DQxNkeZF.cjs → github-Ckgo3Sm-.cjs} +2 -2
- package/lib/{github-D00T8vzj.mjs → github-Cm4qHDkg.mjs} +2 -2
- package/lib/index.cjs +5 -5
- package/lib/index.mjs +5 -5
- package/lib/net/index.cjs +2 -2
- package/lib/net/index.mjs +2 -2
- package/lib/{net-C4QI0aiC.mjs → net-BELapTCw.mjs} +1 -1
- package/lib/{net-BWaaW4mf.cjs → net-CQMRE2g5.cjs} +2 -2
- package/package.json +3 -2
- package/lib/error-CyYI05iP.mjs +0 -3110
- package/lib/error-r4ZSt5Ag.cjs +0 -3194
package/lib/buildkite/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
require('../exec-
|
|
2
|
-
const require_buildkite = require('../buildkite-
|
|
1
|
+
require('../exec-BYbHipiC.cjs');
|
|
2
|
+
const require_buildkite = require('../buildkite-Oza5ZHmO.cjs');
|
|
3
3
|
|
|
4
4
|
exports.annotate = require_buildkite.annotate;
|
|
5
5
|
exports.md = require_buildkite.md;
|
package/lib/buildkite/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-CwYMPI_t.mjs";
|
|
2
|
-
import { n as exec, r as hasCommand } from "./exec-
|
|
3
|
-
import { n as log } from "./error-
|
|
2
|
+
import { n as exec, r as hasCommand } from "./exec-5nrAPCdO.mjs";
|
|
3
|
+
import { n as log } from "./error-DnkB3E6d.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/buildkite/annotate.ts
|
|
6
6
|
const isAnnotationEnabled = async () => Boolean(process.env.BUILDKITE && process.env.BUILDKITE_AGENT_ACCESS_TOKEN && process.env.BUILDKITE_JOB_ID && await hasCommand("buildkite-agent"));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_error = require('./error-
|
|
2
|
-
const require_exec = require('./exec-
|
|
1
|
+
const require_error = require('./error-DwxMLko3.cjs');
|
|
2
|
+
const require_exec = require('./exec-BYbHipiC.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/buildkite/annotate.ts
|
|
5
5
|
const isAnnotationEnabled = async () => Boolean(process.env.BUILDKITE && process.env.BUILDKITE_AGENT_ACCESS_TOKEN && process.env.BUILDKITE_JOB_ID && await require_exec.hasCommand("buildkite-agent"));
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { styleText } from "node:util";
|
|
3
|
+
|
|
4
|
+
//#region ../../src/utils/logging.ts
|
|
5
|
+
const createLogger = ({ debug, prefixes = [], suffixes = [] }) => {
|
|
6
|
+
const logWithoutSuffixes = (...message) => console.log(...prefixes, ...message);
|
|
7
|
+
const log$1 = (...message) => logWithoutSuffixes(...message, ...suffixes);
|
|
8
|
+
return {
|
|
9
|
+
settings: {
|
|
10
|
+
debug,
|
|
11
|
+
prefixes,
|
|
12
|
+
suffixes
|
|
13
|
+
},
|
|
14
|
+
bold: (text) => styleText("bold", text),
|
|
15
|
+
dim: (text) => styleText("dim", text),
|
|
16
|
+
formatSubtle: (text) => styleText("gray", text),
|
|
17
|
+
timing: (start, end) => `${Number((end - start) / BigInt(1e7)) / 100}s`,
|
|
18
|
+
debug: (...message) => debug ? log$1(...message.map((m) => styleText("gray", String(m)))) : void 0,
|
|
19
|
+
subtle: (...message) => log$1(...message.map((m) => styleText("gray", String(m)))),
|
|
20
|
+
err: (...message) => log$1(...message.map((m) => styleText("red", String(m)))),
|
|
21
|
+
newline: () => logWithoutSuffixes(),
|
|
22
|
+
ok: (...message) => log$1(...message.map((m) => styleText("green", String(m)))),
|
|
23
|
+
plain: (...message) => log$1(...message),
|
|
24
|
+
warn: (...message) => log$1(...message.map((m) => styleText("yellow", String(m))))
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const log = createLogger({ debug: false });
|
|
28
|
+
const pluralise = (count, subject) => `${count} ${subject}${count === 1 ? "" : "s"}`;
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ../../src/utils/validation.ts
|
|
32
|
+
const isObject = (value) => typeof value === "object" && value !== null;
|
|
33
|
+
const hasProp = (value, prop) => isObject(value) && value.hasOwnProperty(prop);
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region ../../src/utils/error.ts
|
|
37
|
+
const concurrentlyErrorsSchema = z.array(z.object({
|
|
38
|
+
command: z.object({
|
|
39
|
+
command: z.string(),
|
|
40
|
+
name: z.string()
|
|
41
|
+
}),
|
|
42
|
+
index: z.number(),
|
|
43
|
+
exitCode: z.number()
|
|
44
|
+
}));
|
|
45
|
+
const isErrorWithCode = (err, code) => hasProp(err, "code") && err.code === code;
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { log as n, pluralise as r, isErrorWithCode as t };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
9
|
+
var __exportAll = (all, symbols) => {
|
|
10
|
+
let target = {};
|
|
11
|
+
for (var name in all) {
|
|
12
|
+
__defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (symbols) {
|
|
18
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
19
|
+
}
|
|
20
|
+
return target;
|
|
21
|
+
};
|
|
22
|
+
var __copyProps = (to, from, except, desc) => {
|
|
23
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
24
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
25
|
+
key = keys[i];
|
|
26
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
27
|
+
__defProp(to, key, {
|
|
28
|
+
get: ((k) => from[k]).bind(null, key),
|
|
29
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
38
|
+
value: mod,
|
|
39
|
+
enumerable: true
|
|
40
|
+
}) : target, mod));
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
let util = require("util");
|
|
44
|
+
let zod_v4 = require("zod/v4");
|
|
45
|
+
zod_v4 = __toESM(zod_v4);
|
|
46
|
+
let node_util = require("node:util");
|
|
47
|
+
|
|
48
|
+
//#region ../../src/utils/logging.ts
|
|
49
|
+
const createLogger = ({ debug, prefixes = [], suffixes = [] }) => {
|
|
50
|
+
const logWithoutSuffixes = (...message) => console.log(...prefixes, ...message);
|
|
51
|
+
const log$1 = (...message) => logWithoutSuffixes(...message, ...suffixes);
|
|
52
|
+
return {
|
|
53
|
+
settings: {
|
|
54
|
+
debug,
|
|
55
|
+
prefixes,
|
|
56
|
+
suffixes
|
|
57
|
+
},
|
|
58
|
+
bold: (text) => (0, node_util.styleText)("bold", text),
|
|
59
|
+
dim: (text) => (0, node_util.styleText)("dim", text),
|
|
60
|
+
formatSubtle: (text) => (0, node_util.styleText)("gray", text),
|
|
61
|
+
timing: (start, end) => `${Number((end - start) / BigInt(1e7)) / 100}s`,
|
|
62
|
+
debug: (...message) => debug ? log$1(...message.map((m) => (0, node_util.styleText)("gray", String(m)))) : void 0,
|
|
63
|
+
subtle: (...message) => log$1(...message.map((m) => (0, node_util.styleText)("gray", String(m)))),
|
|
64
|
+
err: (...message) => log$1(...message.map((m) => (0, node_util.styleText)("red", String(m)))),
|
|
65
|
+
newline: () => logWithoutSuffixes(),
|
|
66
|
+
ok: (...message) => log$1(...message.map((m) => (0, node_util.styleText)("green", String(m)))),
|
|
67
|
+
plain: (...message) => log$1(...message),
|
|
68
|
+
warn: (...message) => log$1(...message.map((m) => (0, node_util.styleText)("yellow", String(m))))
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const log = createLogger({ debug: false });
|
|
72
|
+
const pluralise = (count, subject) => `${count} ${subject}${count === 1 ? "" : "s"}`;
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region ../../src/utils/validation.ts
|
|
76
|
+
const isObject = (value) => typeof value === "object" && value !== null;
|
|
77
|
+
const hasProp = (value, prop) => isObject(value) && value.hasOwnProperty(prop);
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region ../../src/utils/error.ts
|
|
81
|
+
const concurrentlyErrorsSchema = zod_v4.array(zod_v4.object({
|
|
82
|
+
command: zod_v4.object({
|
|
83
|
+
command: zod_v4.string(),
|
|
84
|
+
name: zod_v4.string()
|
|
85
|
+
}),
|
|
86
|
+
index: zod_v4.number(),
|
|
87
|
+
exitCode: zod_v4.number()
|
|
88
|
+
}));
|
|
89
|
+
const isErrorWithCode = (err, code) => hasProp(err, "code") && err.code === code;
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
Object.defineProperty(exports, '__commonJSMin', {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () {
|
|
95
|
+
return __commonJSMin;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, '__exportAll', {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () {
|
|
101
|
+
return __exportAll;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
Object.defineProperty(exports, '__reExport', {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function () {
|
|
107
|
+
return __reExport;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(exports, '__toESM', {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function () {
|
|
113
|
+
return __toESM;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(exports, 'isErrorWithCode', {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function () {
|
|
119
|
+
return isErrorWithCode;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, 'log', {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function () {
|
|
125
|
+
return log;
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
Object.defineProperty(exports, 'pluralise', {
|
|
129
|
+
enumerable: true,
|
|
130
|
+
get: function () {
|
|
131
|
+
return pluralise;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as __toESM, i as __require, r as __reExport, t as __commonJSMin } from "./chunk-CwYMPI_t.mjs";
|
|
2
|
-
import { t as isErrorWithCode } from "./error-
|
|
2
|
+
import { t as isErrorWithCode } from "./error-DnkB3E6d.mjs";
|
|
3
3
|
import stream from "stream";
|
|
4
4
|
import util from "util";
|
|
5
5
|
|
package/lib/git/index.cjs
CHANGED
package/lib/git/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as push, d as getHeadCommitMessage, f as currentBranch, g as commit, h as findRoot, i as fastForwardBranch, l as getOwnerAndRepo, m as getChangedFiles, n as isFileGitIgnored, p as commitAllChanges, r as reset, u as getHeadCommitId } from "../git-
|
|
1
|
+
import { a as push, d as getHeadCommitMessage, f as currentBranch, g as commit, h as findRoot, i as fastForwardBranch, l as getOwnerAndRepo, m as getChangedFiles, n as isFileGitIgnored, p as commitAllChanges, r as reset, u as getHeadCommitId } from "../git-QhXK6ooP.mjs";
|
|
2
2
|
|
|
3
3
|
export { commit, commitAllChanges, currentBranch, fastForwardBranch, findRoot, getChangedFiles, getHeadCommitId, getHeadCommitMessage, getOwnerAndRepo, isFileGitIgnored, push, reset };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-CwYMPI_t.mjs";
|
|
2
|
-
import { t as isErrorWithCode } from "./error-
|
|
2
|
+
import { t as isErrorWithCode } from "./error-DnkB3E6d.mjs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import fs from "fs-extra";
|
|
5
5
|
import git, { findRoot } from "isomorphic-git";
|
package/lib/github/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_git = require('../git-
|
|
2
|
-
const require_github = require('../github-
|
|
1
|
+
const require_git = require('../git-B2_B1F3q.cjs');
|
|
2
|
+
const require_github = require('../github-Ckgo3Sm-.cjs');
|
|
3
3
|
|
|
4
4
|
exports.apiTokenFromEnvironment = require_git.apiTokenFromEnvironment;
|
|
5
5
|
exports.buildNameFromEnvironment = require_git.buildNameFromEnvironment;
|
package/lib/github/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as enabledFromEnvironment, o as apiTokenFromEnvironment, s as buildNameFromEnvironment } from "../git-
|
|
2
|
-
import { a as putIssueComment, i as uploadFileChanges, n as readFileChanges, o as getPullRequestNumber, r as uploadAllFileChanges, s as createCheckRun } from "../github-
|
|
1
|
+
import { c as enabledFromEnvironment, o as apiTokenFromEnvironment, s as buildNameFromEnvironment } from "../git-QhXK6ooP.mjs";
|
|
2
|
+
import { a as putIssueComment, i as uploadFileChanges, n as readFileChanges, o as getPullRequestNumber, r as uploadAllFileChanges, s as createCheckRun } from "../github-Cm4qHDkg.mjs";
|
|
3
3
|
|
|
4
4
|
export { apiTokenFromEnvironment, buildNameFromEnvironment, createCheckRun, enabledFromEnvironment, getPullRequestNumber, putIssueComment, readFileChanges, uploadAllFileChanges, uploadFileChanges };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_error = require('./error-
|
|
2
|
-
const require_git = require('./git-
|
|
1
|
+
const require_error = require('./error-DwxMLko3.cjs');
|
|
2
|
+
const require_git = require('./git-B2_B1F3q.cjs');
|
|
3
3
|
let path = require("path");
|
|
4
4
|
path = require_error.__toESM(path);
|
|
5
5
|
let fs_extra = require("fs-extra");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-CwYMPI_t.mjs";
|
|
2
|
-
import { r as pluralise } from "./error-
|
|
3
|
-
import { c as enabledFromEnvironment, h as findRoot, i as fastForwardBranch, l as getOwnerAndRepo, m as getChangedFiles, o as apiTokenFromEnvironment, s as buildNameFromEnvironment, u as getHeadCommitId } from "./git-
|
|
2
|
+
import { r as pluralise } from "./error-DnkB3E6d.mjs";
|
|
3
|
+
import { c as enabledFromEnvironment, h as findRoot, i as fastForwardBranch, l as getOwnerAndRepo, m as getChangedFiles, o as apiTokenFromEnvironment, s as buildNameFromEnvironment, u as getHeadCommitId } from "./git-QhXK6ooP.mjs";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import fs from "fs-extra";
|
|
6
6
|
|
package/lib/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
require('./exec-
|
|
2
|
-
const require_buildkite = require('./buildkite-
|
|
3
|
-
const require_git = require('./git-
|
|
4
|
-
const require_github = require('./github-
|
|
5
|
-
const require_net = require('./net-
|
|
1
|
+
require('./exec-BYbHipiC.cjs');
|
|
2
|
+
const require_buildkite = require('./buildkite-Oza5ZHmO.cjs');
|
|
3
|
+
const require_git = require('./git-B2_B1F3q.cjs');
|
|
4
|
+
const require_github = require('./github-Ckgo3Sm-.cjs');
|
|
5
|
+
const require_net = require('./net-CQMRE2g5.cjs');
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, 'Buildkite', {
|
|
8
8
|
enumerable: true,
|
package/lib/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./exec-
|
|
2
|
-
import { t as buildkite_exports } from "./buildkite-
|
|
3
|
-
import { t as git_exports } from "./git-
|
|
4
|
-
import { t as github_exports } from "./github-
|
|
5
|
-
import { t as net_exports } from "./net-
|
|
1
|
+
import "./exec-5nrAPCdO.mjs";
|
|
2
|
+
import { t as buildkite_exports } from "./buildkite-DQj9dGPb.mjs";
|
|
3
|
+
import { t as git_exports } from "./git-QhXK6ooP.mjs";
|
|
4
|
+
import { t as github_exports } from "./github-Cm4qHDkg.mjs";
|
|
5
|
+
import { t as net_exports } from "./net-BELapTCw.mjs";
|
|
6
6
|
|
|
7
7
|
export { buildkite_exports as Buildkite, git_exports as Git, github_exports as GitHub, net_exports as Net };
|
package/lib/net/index.cjs
CHANGED
package/lib/net/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_error = require('./error-
|
|
2
|
-
const require_exec = require('./exec-
|
|
1
|
+
const require_error = require('./error-DwxMLko3.cjs');
|
|
2
|
+
const require_exec = require('./exec-BYbHipiC.cjs');
|
|
3
3
|
let net = require("net");
|
|
4
4
|
net = require_error.__toESM(net);
|
|
5
5
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skuba-lib/api",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Node.js development API for skuba",
|
|
5
5
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"@octokit/types": "^16.0.0",
|
|
51
51
|
"fs-extra": "^11.0.0",
|
|
52
52
|
"ignore": "^7.0.0",
|
|
53
|
-
"isomorphic-git": "^1.11.1"
|
|
53
|
+
"isomorphic-git": "^1.11.1",
|
|
54
|
+
"zod": "^4.3.5"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"tsdown": "^0.19.0"
|