@marlinjai/clearify 1.19.0 → 1.20.0

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.
@@ -282,7 +282,7 @@ ${hasInternal ? `
282
282
  `);
283
283
  const secretMode = options.secretMode ?? "prompt";
284
284
  if (options.hub) {
285
- const { registerWithHub } = await import("./hub-register-M7C3G3FE.js");
285
+ const { registerWithHub } = await import("./hub-register-7NF5BP3E.js");
286
286
  await registerWithHub({
287
287
  projectName: detectProjectName(),
288
288
  hubToken: options.hubToken,
@@ -298,7 +298,7 @@ ${hasInternal ? `
298
298
  });
299
299
  rl.close();
300
300
  if (answer.toLowerCase() === "y") {
301
- const { registerWithHub } = await import("./hub-register-M7C3G3FE.js");
301
+ const { registerWithHub } = await import("./hub-register-7NF5BP3E.js");
302
302
  await registerWithHub({
303
303
  projectName: detectProjectName(),
304
304
  hubToken: options.hubToken,
@@ -310,9 +310,15 @@ jobs:
310
310
  }
311
311
  async function registerWithHub(options) {
312
312
  const clientId = process.env.CLEARIFY_GITHUB_CLIENT_ID;
313
- if (!clientId) {
314
- console.error("\n Error: CLEARIFY_GITHUB_CLIENT_ID environment variable is not set.");
315
- console.error(" Set it to your GitHub OAuth App client ID and try again.\n");
313
+ if (!clientId && !options.hubToken) {
314
+ console.error("\n Error: no GitHub credentials available for hub onboarding.");
315
+ console.error(" Clearify needs one of these to write the hub registry entry:\n");
316
+ console.error(" 1) Set CLEARIFY_GITHUB_CLIENT_ID to a GitHub OAuth App client ID");
317
+ console.error(" (create one at https://github.com/settings/applications/new,");
318
+ console.error(' scope "repo"), then re-run this command.');
319
+ console.error(" 2) Pass --hub-token <pat> to use a Personal Access Token directly");
320
+ console.error(' (fine-grained PAT with "Contents: Read and Write" on the hub repo).');
321
+ console.error("");
316
322
  process.exit(1);
317
323
  }
318
324
  const projectName = options.projectName ?? detectProjectName();
@@ -328,8 +334,14 @@ async function registerWithHub(options) {
328
334
  const hub = await promptHubRepo();
329
335
  console.log(` Hub: ${hub.owner}/${hub.repo}
330
336
  `);
331
- console.log(" Starting GitHub authentication...");
332
- const token = await githubDeviceAuth(clientId);
337
+ let token;
338
+ if (options.hubToken) {
339
+ console.log(" Using provided --hub-token for GitHub API calls.");
340
+ token = options.hubToken;
341
+ } else {
342
+ console.log(" Starting GitHub authentication...");
343
+ token = await githubDeviceAuth(clientId);
344
+ }
333
345
  console.log(" Updating hub registry...");
334
346
  await updateHubRegistry(token, hub, {
335
347
  name: projectName,
@@ -11,7 +11,7 @@ import {
11
11
  import "../chunk-B2Q23JW3.js";
12
12
  import {
13
13
  init
14
- } from "../chunk-HVHCUAVU.js";
14
+ } from "../chunk-JZZ2BNIL.js";
15
15
  import {
16
16
  checkFrontmatter,
17
17
  checkLinks
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init
3
- } from "../chunk-HVHCUAVU.js";
3
+ } from "../chunk-JZZ2BNIL.js";
4
4
  export {
5
5
  init
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marlinjai/clearify",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "An open-source documentation site generator. Turn markdown into beautiful docs.",
5
5
  "type": "module",
6
6
  "bin": {