@skuba-lib/api 2.0.1 → 2.0.3-build-package-patch-2-20260226003820
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/buildkite/package.json +1 -1
- package/git/package.json +1 -1
- package/github/package.json +1 -1
- package/lib/buildkite/index.cjs +19 -4
- package/lib/buildkite/index.d.cts +8 -2
- package/lib/buildkite/index.d.mts +8 -2
- package/lib/buildkite/index.mjs +11 -3
- package/lib/{chunk-CwYMPI_t.mjs → chunk-DoQ1iNfF.mjs} +3 -3
- package/lib/{error-DwxMLko3.cjs → error-BEFwIvK2.cjs} +10 -10
- package/lib/{error-DnkB3E6d.mjs → error-DIBTmfX2.mjs} +7 -7
- package/lib/{exec-5nrAPCdO.mjs → exec-Bcan8fLb.mjs} +268 -268
- package/lib/{exec-BYbHipiC.cjs → exec-CVlcoV9u.cjs} +261 -261
- package/lib/git/index.cjs +38 -13
- package/lib/git/index.d.cts +8 -2
- package/lib/git/index.d.mts +8 -2
- package/lib/git/index.mjs +20 -2
- package/lib/github/index.cjs +33 -11
- package/lib/github/index.d.cts +8 -2
- package/lib/github/index.d.mts +8 -2
- package/lib/github/index.mjs +18 -3
- package/lib/index.cjs +13 -9
- package/lib/index.d.cts +4 -4
- package/lib/index.d.mts +5 -4
- package/lib/index.mjs +8 -5
- package/lib/{git-B2_B1F3q.cjs → isFileGitIgnored-Bwd16lEn.cjs} +4 -27
- package/lib/{index-Dl0KmK1O.d.cts → isFileGitIgnored-CwPJ0v2p.d.mts} +1 -4
- package/lib/{git-QhXK6ooP.mjs → isFileGitIgnored-DsgFRsI5.mjs} +3 -21
- package/lib/{index-BqiB0-6w.d.mts → isFileGitIgnored-E4x_jWjl.d.cts} +1 -4
- package/lib/{index-BOr919w6.d.cts → md-BWCfQS9I.d.cts} +1 -4
- package/lib/{index-CW8ZTeZU.d.mts → md-BZewxkUW.d.mts} +1 -4
- package/lib/{buildkite-DQj9dGPb.mjs → md-CvXERddQ.mjs} +3 -11
- package/lib/{buildkite-Oza5ZHmO.cjs → md-fbyvRhpo.cjs} +2 -15
- package/lib/net/index.cjs +15 -3
- package/lib/net/index.d.cts +8 -2
- package/lib/net/index.d.mts +8 -2
- package/lib/net/index.mjs +8 -3
- package/lib/{index-4aCFuPgQ.d.mts → push-BTAssEjq.d.cts} +3 -6
- package/lib/{index-DfhDLrNc.d.cts → push-Bv-gtPfj.d.mts} +3 -6
- package/lib/{github-Ckgo3Sm-.cjs → push-DMpMs9CT.cjs} +16 -35
- package/lib/{github-Cm4qHDkg.mjs → push-DfTF3Swx.mjs} +5 -19
- package/lib/{net-BELapTCw.mjs → waitFor-D1MlNL9G.mjs} +2 -7
- package/lib/{index-B8rqBqBj.d.cts → waitFor-DGgQAaUj.d.mts} +1 -4
- package/lib/{index-CZi-UcD_.d.mts → waitFor-LnjEb972.d.cts} +1 -4
- package/lib/{net-CQMRE2g5.cjs → waitFor-PklD-Jqp.cjs} +2 -12
- package/net/package.json +1 -1
- package/package.json +12 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_error = require('./error-
|
|
2
|
-
const
|
|
1
|
+
const require_error = require('./error-BEFwIvK2.cjs');
|
|
2
|
+
const require_isFileGitIgnored = require('./isFileGitIgnored-Bwd16lEn.cjs');
|
|
3
3
|
let path = require("path");
|
|
4
4
|
path = require_error.__toESM(path);
|
|
5
5
|
let fs_extra = require("fs-extra");
|
|
@@ -36,8 +36,8 @@ const createEnrichedSummary = (summary, inputAnnotations) => [summary, ...inputA
|
|
|
36
36
|
*/
|
|
37
37
|
const createCheckRun = async ({ annotations, conclusion, name, summary, text, title }) => {
|
|
38
38
|
const dir = process.cwd();
|
|
39
|
-
const [commitId, { owner, repo }] = await Promise.all([
|
|
40
|
-
await (await createRestClient({ auth:
|
|
39
|
+
const [commitId, { owner, repo }] = await Promise.all([require_isFileGitIgnored.getHeadCommitId({ dir }), require_isFileGitIgnored.getOwnerAndRepo({ dir })]);
|
|
40
|
+
await (await createRestClient({ auth: require_isFileGitIgnored.apiTokenFromEnvironment() })).checks.create({
|
|
41
41
|
conclusion,
|
|
42
42
|
head_sha: commitId,
|
|
43
43
|
name,
|
|
@@ -65,13 +65,13 @@ const createCheckRun = async ({ annotations, conclusion, name, summary, text, ti
|
|
|
65
65
|
const getPullRequestNumber = async (params = {}) => {
|
|
66
66
|
const env = params.env ?? process.env;
|
|
67
67
|
const dir = process.cwd();
|
|
68
|
-
const number = Number(env.BUILDKITE_PULL_REQUEST ?? env.GITHUB_REF?.replace(/^refs\/pull\/(\d+)
|
|
68
|
+
const number = Number(env.BUILDKITE_PULL_REQUEST ?? env.GITHUB_REF?.replace(/^refs\/pull\/(\d+)/, "$1"));
|
|
69
69
|
if (Number.isSafeInteger(number)) return number;
|
|
70
|
-
const client = params.client ?? await createRestClient({ auth:
|
|
71
|
-
const [commitId, { owner, repo }] = await Promise.all([
|
|
70
|
+
const client = params.client ?? await createRestClient({ auth: require_isFileGitIgnored.apiTokenFromEnvironment() });
|
|
71
|
+
const [commitId, { owner, repo }] = await Promise.all([require_isFileGitIgnored.getHeadCommitId({
|
|
72
72
|
dir,
|
|
73
73
|
env
|
|
74
|
-
}),
|
|
74
|
+
}), require_isFileGitIgnored.getOwnerAndRepo({ dir })]);
|
|
75
75
|
const pullRequestData = (await client.repos.listPullRequestsAssociatedWithCommit({
|
|
76
76
|
commit_sha: commitId,
|
|
77
77
|
owner,
|
|
@@ -102,8 +102,8 @@ const putIssueComment = async (params) => {
|
|
|
102
102
|
if (params.body === null && !params.internalId) throw new Error("Cannot remove comment without an internalId");
|
|
103
103
|
const env = params.env ?? process.env;
|
|
104
104
|
const dir = process.cwd();
|
|
105
|
-
const { owner, repo } = await
|
|
106
|
-
const client = await createRestClient({ auth:
|
|
105
|
+
const { owner, repo } = await require_isFileGitIgnored.getOwnerAndRepo({ dir });
|
|
106
|
+
const client = await createRestClient({ auth: require_isFileGitIgnored.apiTokenFromEnvironment() });
|
|
107
107
|
const issueNumber = params.issueNumber ?? await getPullRequestNumber({
|
|
108
108
|
client,
|
|
109
109
|
env
|
|
@@ -154,12 +154,13 @@ const putIssueComment = async (params) => {
|
|
|
154
154
|
* specified.
|
|
155
155
|
*/
|
|
156
156
|
const uploadAllFileChanges = async ({ branch, dir, messageHeadline, ignore, messageBody, updateLocal = false }) => {
|
|
157
|
-
const changedFiles = await
|
|
157
|
+
const changedFiles = await require_isFileGitIgnored.getChangedFiles({
|
|
158
158
|
dir,
|
|
159
159
|
ignore
|
|
160
160
|
});
|
|
161
161
|
if (!changedFiles.length) return;
|
|
162
162
|
const fileChanges = await readFileChanges(dir, changedFiles);
|
|
163
|
+
console.dir(fileChanges, { depth: null });
|
|
163
164
|
const commitId = await uploadFileChanges({
|
|
164
165
|
dir,
|
|
165
166
|
branch,
|
|
@@ -169,7 +170,7 @@ const uploadAllFileChanges = async ({ branch, dir, messageHeadline, ignore, mess
|
|
|
169
170
|
});
|
|
170
171
|
if (updateLocal) {
|
|
171
172
|
await Promise.all([...fileChanges.additions, ...fileChanges.deletions].map((file) => fs_extra.default.rm(file.path)));
|
|
172
|
-
await
|
|
173
|
+
await require_isFileGitIgnored.fastForwardBranch({
|
|
173
174
|
ref: branch,
|
|
174
175
|
auth: { type: "gitHubApp" },
|
|
175
176
|
dir
|
|
@@ -193,7 +194,7 @@ const readFileChanges = async (dir, changedFiles) => {
|
|
|
193
194
|
added: [],
|
|
194
195
|
deleted: []
|
|
195
196
|
});
|
|
196
|
-
const gitRoot = await
|
|
197
|
+
const gitRoot = await require_isFileGitIgnored.findRoot({ dir });
|
|
197
198
|
const toRootPath = (filePath) => {
|
|
198
199
|
if (!gitRoot) return filePath;
|
|
199
200
|
return path.default.resolve(gitRoot, filePath);
|
|
@@ -214,9 +215,9 @@ const readFileChanges = async (dir, changedFiles) => {
|
|
|
214
215
|
* This will not update the local Git repository.
|
|
215
216
|
*/
|
|
216
217
|
const uploadFileChanges = async ({ dir, branch, messageHeadline, messageBody, fileChanges }) => {
|
|
217
|
-
const authToken =
|
|
218
|
+
const authToken = require_isFileGitIgnored.apiTokenFromEnvironment();
|
|
218
219
|
if (!authToken) throw new Error("Could not read a GitHub API token from the environment. Please set GITHUB_API_TOKEN or GITHUB_TOKEN.");
|
|
219
|
-
const [{ owner, repo }, headCommitId] = await Promise.all([
|
|
220
|
+
const [{ owner, repo }, headCommitId] = await Promise.all([require_isFileGitIgnored.getOwnerAndRepo({ dir }), require_isFileGitIgnored.getHeadCommitId({ dir })]);
|
|
220
221
|
return (await graphql(`
|
|
221
222
|
mutation Mutation($input: CreateCommitOnBranchInput!) {
|
|
222
223
|
createCommitOnBranch(input: $input) {
|
|
@@ -243,20 +244,6 @@ const uploadFileChanges = async ({ dir, branch, messageHeadline, messageBody, fi
|
|
|
243
244
|
})).createCommitOnBranch.commit.oid;
|
|
244
245
|
};
|
|
245
246
|
|
|
246
|
-
//#endregion
|
|
247
|
-
//#region src/github/index.ts
|
|
248
|
-
var github_exports = /* @__PURE__ */ require_error.__exportAll({
|
|
249
|
-
apiTokenFromEnvironment: () => require_git.apiTokenFromEnvironment,
|
|
250
|
-
buildNameFromEnvironment: () => require_git.buildNameFromEnvironment,
|
|
251
|
-
createCheckRun: () => createCheckRun,
|
|
252
|
-
enabledFromEnvironment: () => require_git.enabledFromEnvironment,
|
|
253
|
-
getPullRequestNumber: () => getPullRequestNumber,
|
|
254
|
-
putIssueComment: () => putIssueComment,
|
|
255
|
-
readFileChanges: () => readFileChanges,
|
|
256
|
-
uploadAllFileChanges: () => uploadAllFileChanges,
|
|
257
|
-
uploadFileChanges: () => uploadFileChanges
|
|
258
|
-
});
|
|
259
|
-
|
|
260
247
|
//#endregion
|
|
261
248
|
Object.defineProperty(exports, 'createCheckRun', {
|
|
262
249
|
enumerable: true,
|
|
@@ -270,12 +257,6 @@ Object.defineProperty(exports, 'getPullRequestNumber', {
|
|
|
270
257
|
return getPullRequestNumber;
|
|
271
258
|
}
|
|
272
259
|
});
|
|
273
|
-
Object.defineProperty(exports, 'github_exports', {
|
|
274
|
-
enumerable: true,
|
|
275
|
-
get: function () {
|
|
276
|
-
return github_exports;
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
260
|
Object.defineProperty(exports, 'putIssueComment', {
|
|
280
261
|
enumerable: true,
|
|
281
262
|
get: function () {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as
|
|
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";
|
|
1
|
+
import { r as pluralise } from "./error-DIBTmfX2.mjs";
|
|
2
|
+
import { a as apiTokenFromEnvironment, c as getOwnerAndRepo, l as getHeadCommitId, m as findRoot, p as getChangedFiles, r as fastForwardBranch } from "./isFileGitIgnored-DsgFRsI5.mjs";
|
|
4
3
|
import path from "path";
|
|
5
4
|
import fs from "fs-extra";
|
|
6
5
|
|
|
@@ -64,7 +63,7 @@ const createCheckRun = async ({ annotations, conclusion, name, summary, text, ti
|
|
|
64
63
|
const getPullRequestNumber = async (params = {}) => {
|
|
65
64
|
const env = params.env ?? process.env;
|
|
66
65
|
const dir = process.cwd();
|
|
67
|
-
const number = Number(env.BUILDKITE_PULL_REQUEST ?? env.GITHUB_REF?.replace(/^refs\/pull\/(\d+)
|
|
66
|
+
const number = Number(env.BUILDKITE_PULL_REQUEST ?? env.GITHUB_REF?.replace(/^refs\/pull\/(\d+)/, "$1"));
|
|
68
67
|
if (Number.isSafeInteger(number)) return number;
|
|
69
68
|
const client = params.client ?? await createRestClient({ auth: apiTokenFromEnvironment() });
|
|
70
69
|
const [commitId, { owner, repo }] = await Promise.all([getHeadCommitId({
|
|
@@ -159,6 +158,7 @@ const uploadAllFileChanges = async ({ branch, dir, messageHeadline, ignore, mess
|
|
|
159
158
|
});
|
|
160
159
|
if (!changedFiles.length) return;
|
|
161
160
|
const fileChanges = await readFileChanges(dir, changedFiles);
|
|
161
|
+
console.dir(fileChanges, { depth: null });
|
|
162
162
|
const commitId = await uploadFileChanges({
|
|
163
163
|
dir,
|
|
164
164
|
branch,
|
|
@@ -243,18 +243,4 @@ const uploadFileChanges = async ({ dir, branch, messageHeadline, messageBody, fi
|
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
//#endregion
|
|
246
|
-
|
|
247
|
-
var github_exports = /* @__PURE__ */ __exportAll({
|
|
248
|
-
apiTokenFromEnvironment: () => apiTokenFromEnvironment,
|
|
249
|
-
buildNameFromEnvironment: () => buildNameFromEnvironment,
|
|
250
|
-
createCheckRun: () => createCheckRun,
|
|
251
|
-
enabledFromEnvironment: () => enabledFromEnvironment,
|
|
252
|
-
getPullRequestNumber: () => getPullRequestNumber,
|
|
253
|
-
putIssueComment: () => putIssueComment,
|
|
254
|
-
readFileChanges: () => readFileChanges,
|
|
255
|
-
uploadAllFileChanges: () => uploadAllFileChanges,
|
|
256
|
-
uploadFileChanges: () => uploadFileChanges
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
//#endregion
|
|
260
|
-
export { putIssueComment as a, uploadFileChanges as i, readFileChanges as n, getPullRequestNumber as o, uploadAllFileChanges as r, createCheckRun as s, github_exports as t };
|
|
246
|
+
export { getPullRequestNumber as a, putIssueComment as i, uploadAllFileChanges as n, createCheckRun as o, uploadFileChanges as r, readFileChanges as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createExec } from "./exec-5nrAPCdO.mjs";
|
|
1
|
+
import { t as createExec } from "./exec-Bcan8fLb.mjs";
|
|
3
2
|
import net from "net";
|
|
4
3
|
|
|
5
4
|
//#region src/net/compose.ts
|
|
@@ -65,8 +64,4 @@ const waitFor = async ({ host = "localhost", port, resolveCompose = false, timeo
|
|
|
65
64
|
};
|
|
66
65
|
|
|
67
66
|
//#endregion
|
|
68
|
-
|
|
69
|
-
var net_exports = /* @__PURE__ */ __exportAll({ waitFor: () => waitFor });
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
export { waitFor as n, net_exports as t };
|
|
67
|
+
export { waitFor as t };
|
|
@@ -31,8 +31,5 @@ declare const waitFor: ({
|
|
|
31
31
|
resolveCompose?: boolean;
|
|
32
32
|
timeout?: number;
|
|
33
33
|
}) => Promise<SocketAddress>;
|
|
34
|
-
declare namespace index_d_exports {
|
|
35
|
-
export { waitFor };
|
|
36
|
-
}
|
|
37
34
|
//#endregion
|
|
38
|
-
export { waitFor as
|
|
35
|
+
export { waitFor as t };
|
|
@@ -31,8 +31,5 @@ declare const waitFor: ({
|
|
|
31
31
|
resolveCompose?: boolean;
|
|
32
32
|
timeout?: number;
|
|
33
33
|
}) => Promise<SocketAddress>;
|
|
34
|
-
declare namespace index_d_exports {
|
|
35
|
-
export { waitFor };
|
|
36
|
-
}
|
|
37
34
|
//#endregion
|
|
38
|
-
export { waitFor as
|
|
35
|
+
export { waitFor as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_error = require('./error-
|
|
2
|
-
const require_exec = require('./exec-
|
|
1
|
+
const require_error = require('./error-BEFwIvK2.cjs');
|
|
2
|
+
const require_exec = require('./exec-CVlcoV9u.cjs');
|
|
3
3
|
let net = require("net");
|
|
4
4
|
net = require_error.__toESM(net);
|
|
5
5
|
|
|
@@ -66,16 +66,6 @@ const waitFor = async ({ host = "localhost", port, resolveCompose = false, timeo
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region src/net/index.ts
|
|
70
|
-
var net_exports = /* @__PURE__ */ require_error.__exportAll({ waitFor: () => waitFor });
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
Object.defineProperty(exports, 'net_exports', {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function () {
|
|
76
|
-
return net_exports;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
69
|
Object.defineProperty(exports, 'waitFor', {
|
|
80
70
|
enumerable: true,
|
|
81
71
|
get: function () {
|
package/net/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skuba-lib/api",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-build-package-patch-2-20260226003820",
|
|
4
4
|
"description": "Node.js development API for skuba",
|
|
5
5
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -13,24 +13,24 @@
|
|
|
13
13
|
},
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
16
|
+
"import": "./lib/index.mjs",
|
|
17
|
+
"require": "./lib/index.cjs"
|
|
18
18
|
},
|
|
19
19
|
"./buildkite": {
|
|
20
|
-
"
|
|
21
|
-
"
|
|
20
|
+
"import": "./lib/buildkite/index.mjs",
|
|
21
|
+
"require": "./lib/buildkite/index.cjs"
|
|
22
22
|
},
|
|
23
23
|
"./git": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"import": "./lib/git/index.mjs",
|
|
25
|
+
"require": "./lib/git/index.cjs"
|
|
26
26
|
},
|
|
27
27
|
"./github": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"import": "./lib/github/index.mjs",
|
|
29
|
+
"require": "./lib/github/index.cjs"
|
|
30
30
|
},
|
|
31
31
|
"./net": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"import": "./lib/net/index.mjs",
|
|
33
|
+
"require": "./lib/net/index.cjs"
|
|
34
34
|
},
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"zod": "^4.3.5"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"tsdown": "^0.
|
|
57
|
+
"tsdown": "^0.20.0"
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=22.14.0"
|