@theholocron/holocron-plugin-github 5.0.0-alpha.381 → 5.0.0-alpha.383

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.
Files changed (2) hide show
  1. package/dist/index.mjs +8 -1
  2. package/package.json +9 -9
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module";
2
- import { AuthError, MissingTokenError, ProviderApiError, connectionProbe, createFeatureResolver, pickByCreation, readKeysLimited } from "@theholocron/cli";
2
+ import { AuthError, MissingTokenError, ProviderApiError, connectionProbe, createFeatureResolver, pickByCreation, readKeysLimited, reportProgress } from "@theholocron/cli";
3
3
  import { createGitHubClient, createGitHubClient as createGitHubClient$1 } from "@theholocron/github-client";
4
4
  import { mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
5
5
  import { dirname, join } from "node:path";
@@ -253,6 +253,7 @@ async function readIssues(client, repo, selector, info) {
253
253
  }
254
254
  const records = [];
255
255
  for (const issue of issues) {
256
+ reportProgress(info.onProgress, records.length, issues.length);
256
257
  const comments = await client.issues.listComments(repo, issue.number);
257
258
  const links = (await client.graphql.query(LINK_QUERY, {
258
259
  owner,
@@ -289,6 +290,7 @@ async function readIssues(client, repo, selector, info) {
289
290
  ...migratedFrom ? { migratedFrom } : {}
290
291
  });
291
292
  }
293
+ reportProgress(info.onProgress, records.length, issues.length);
292
294
  return records;
293
295
  }
294
296
  /** Makes the records as issues, skipping any whose source address an earlier run already recorded. */
@@ -299,6 +301,7 @@ async function importIssues(client, repo, records, options = {}) {
299
301
  if (url) existing.set(url, issue.number);
300
302
  }
301
303
  const results = [];
304
+ const tick = () => reportProgress(options.onProgress, results.length, records.length);
302
305
  for (const record of records) {
303
306
  const found = existing.get(record.url);
304
307
  if (found !== void 0) {
@@ -308,6 +311,7 @@ async function importIssues(client, repo, records, options = {}) {
308
311
  created: false,
309
312
  dropped: []
310
313
  });
314
+ tick();
311
315
  continue;
312
316
  }
313
317
  const dropped = droppedFor(record);
@@ -317,6 +321,7 @@ async function importIssues(client, repo, records, options = {}) {
317
321
  created: true,
318
322
  dropped
319
323
  });
324
+ tick();
320
325
  continue;
321
326
  }
322
327
  const number = await createFromRecord(client, repo, record, options);
@@ -326,6 +331,7 @@ async function importIssues(client, repo, records, options = {}) {
326
331
  created: true,
327
332
  dropped
328
333
  });
334
+ tick();
329
335
  }
330
336
  return results;
331
337
  }
@@ -410,6 +416,7 @@ async function syncIssues(client, repo, records, options = {}) {
410
416
  for (const record of records) try {
411
417
  const found = existing.get(record.url);
412
418
  results.push(found ? await update(client, repo, found, record, options) : await create(client, repo, record, options));
419
+ reportProgress(options.onProgress, results.length, records.length);
413
420
  } catch (err) {
414
421
  if (isRateLimited(err)) return results;
415
422
  throw err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-github",
3
- "version": "5.0.0-alpha.381",
3
+ "version": "5.0.0-alpha.383",
4
4
  "description": "Holocron plugin for GitHub. Implements source, ci, secrets, environments, and issues capabilities against the GitHub REST API.",
5
5
  "keywords": [
6
6
  "ci",
@@ -44,21 +44,21 @@
44
44
  "tsx": "4.23.15",
45
45
  "typescript": "^5.9.3",
46
46
  "vitest": "^5.1.0",
47
- "@theholocron/cli": "5.0.0-alpha.381",
48
- "@theholocron/eslint-config": "^8.9.0-alpha.12",
47
+ "@theholocron/cli": "5.0.0-alpha.383",
48
+ "@theholocron/eslint-config": "^8.9.0-alpha.13",
49
49
  "@theholocron/fs-utils": "^1.17.0-alpha.2",
50
- "@theholocron/github-client": "^1.58.0-alpha.22",
51
50
  "@theholocron/misc-utils": "^1.17.0-alpha.2",
52
- "@theholocron/http-client": "^1.58.0-alpha.22",
53
- "@theholocron/tsconfig": "^8.9.0-alpha.12",
54
- "@theholocron/vitest-config": "^8.9.0-alpha.12",
55
- "@theholocron/tsdown-config": "^8.9.0-alpha.12"
51
+ "@theholocron/http-client": "^1.58.0-alpha.23",
52
+ "@theholocron/tsconfig": "^8.9.0-alpha.13",
53
+ "@theholocron/tsdown-config": "^8.9.0-alpha.13",
54
+ "@theholocron/vitest-config": "^8.9.0-alpha.13",
55
+ "@theholocron/github-client": "^1.58.0-alpha.23"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "@theholocron/fs-utils": "^1.16.0",
59
59
  "@theholocron/github-client": "^1.58.0",
60
60
  "@theholocron/misc-utils": "^1.16.0",
61
- "@theholocron/cli": "5.0.0-alpha.381"
61
+ "@theholocron/cli": "5.0.0-alpha.383"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=22"