@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-
|
|
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-
|
|
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:
|
|
315
|
-
console.error("
|
|
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
|
-
|
|
332
|
-
|
|
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,
|
package/dist/node/node/index.js
CHANGED
package/dist/node/node/init.js
CHANGED