@marlinjai/clearify 1.19.0 → 2.0.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.
- package/dist/config-schema.json +142 -44
- package/dist/node/{chunk-XR4WG237.js → chunk-BCEGDIR6.js} +2 -2
- package/dist/node/{chunk-HZRIVY25.js → chunk-CK2SLBAG.js} +1 -1
- package/dist/node/{chunk-HVHCUAVU.js → chunk-GPBEDIOY.js} +2 -2
- package/dist/node/{chunk-2WML2D77.js → chunk-PGTNVDNF.js} +61 -31
- package/dist/node/{chunk-GWYMXKDL.js → chunk-RW4IKHY4.js} +1 -1
- package/dist/node/core/config.d.ts +23 -11
- package/dist/node/core/config.js +1 -1
- package/dist/node/{hub-register-M7C3G3FE.js → hub-register-QB73GUF2.js} +23 -8
- package/dist/node/node/build.js +3 -3
- package/dist/node/node/check.js +2 -2
- package/dist/node/node/index.js +5 -5
- package/dist/node/node/init.js +1 -1
- package/dist/node/types/index.d.ts +66 -8
- package/dist/node/vite-plugin/index.js +2 -2
- package/package.json +5 -3
- package/src/theme/Sidebar.tsx +2 -2
- package/src/theme/admin/ProjectsManager.tsx +227 -109
- package/src/theme/components/ProjectGrid.tsx +17 -1
package/dist/config-schema.json
CHANGED
|
@@ -116,9 +116,6 @@
|
|
|
116
116
|
"description": {
|
|
117
117
|
"type": "string"
|
|
118
118
|
},
|
|
119
|
-
"href": {
|
|
120
|
-
"type": "string"
|
|
121
|
-
},
|
|
122
119
|
"repo": {
|
|
123
120
|
"type": "string"
|
|
124
121
|
},
|
|
@@ -144,64 +141,165 @@
|
|
|
144
141
|
"group": {
|
|
145
142
|
"type": "string"
|
|
146
143
|
},
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
144
|
+
"source": {
|
|
145
|
+
"oneOf": [
|
|
146
|
+
{
|
|
147
|
+
"type": "object",
|
|
148
|
+
"properties": {
|
|
149
|
+
"kind": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"const": "none"
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"required": [
|
|
155
|
+
"kind"
|
|
156
|
+
],
|
|
157
|
+
"additionalProperties": false
|
|
160
158
|
},
|
|
161
|
-
|
|
162
|
-
"type": "
|
|
159
|
+
{
|
|
160
|
+
"type": "object",
|
|
161
|
+
"properties": {
|
|
162
|
+
"kind": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"const": "git"
|
|
165
|
+
},
|
|
166
|
+
"repo": {
|
|
167
|
+
"type": "string"
|
|
168
|
+
},
|
|
169
|
+
"ref": {
|
|
170
|
+
"type": "string"
|
|
171
|
+
},
|
|
172
|
+
"path": {
|
|
173
|
+
"type": "string"
|
|
174
|
+
},
|
|
175
|
+
"sparse": {
|
|
176
|
+
"type": "boolean"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"required": [
|
|
180
|
+
"kind",
|
|
181
|
+
"repo"
|
|
182
|
+
],
|
|
183
|
+
"additionalProperties": false
|
|
163
184
|
},
|
|
164
|
-
|
|
165
|
-
"type": "
|
|
185
|
+
{
|
|
186
|
+
"type": "object",
|
|
187
|
+
"properties": {
|
|
188
|
+
"kind": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"const": "url"
|
|
191
|
+
},
|
|
192
|
+
"url": {
|
|
193
|
+
"type": "string"
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"required": [
|
|
197
|
+
"kind",
|
|
198
|
+
"url"
|
|
199
|
+
],
|
|
200
|
+
"additionalProperties": false
|
|
166
201
|
},
|
|
167
|
-
|
|
168
|
-
"type": "
|
|
202
|
+
{
|
|
203
|
+
"type": "object",
|
|
204
|
+
"properties": {
|
|
205
|
+
"kind": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"const": "inline"
|
|
208
|
+
},
|
|
209
|
+
"markdown": {
|
|
210
|
+
"type": "string"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"required": [
|
|
214
|
+
"kind",
|
|
215
|
+
"markdown"
|
|
216
|
+
],
|
|
217
|
+
"additionalProperties": false
|
|
169
218
|
}
|
|
170
|
-
|
|
171
|
-
"required": [
|
|
172
|
-
"repo"
|
|
173
|
-
],
|
|
174
|
-
"additionalProperties": false
|
|
219
|
+
]
|
|
175
220
|
},
|
|
176
|
-
"
|
|
177
|
-
"
|
|
221
|
+
"placement": {
|
|
222
|
+
"oneOf": [
|
|
178
223
|
{
|
|
179
|
-
"type": "
|
|
180
|
-
"
|
|
224
|
+
"type": "object",
|
|
225
|
+
"properties": {
|
|
226
|
+
"kind": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"const": "card"
|
|
229
|
+
},
|
|
230
|
+
"href": {
|
|
231
|
+
"type": "string"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"required": [
|
|
235
|
+
"kind",
|
|
236
|
+
"href"
|
|
237
|
+
],
|
|
238
|
+
"additionalProperties": false
|
|
181
239
|
},
|
|
182
240
|
{
|
|
183
|
-
"type": "
|
|
184
|
-
"
|
|
241
|
+
"type": "object",
|
|
242
|
+
"properties": {
|
|
243
|
+
"kind": {
|
|
244
|
+
"type": "string",
|
|
245
|
+
"const": "tab"
|
|
246
|
+
},
|
|
247
|
+
"sections": {
|
|
248
|
+
"anyOf": [
|
|
249
|
+
{
|
|
250
|
+
"type": "string",
|
|
251
|
+
"const": "all"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"type": "string",
|
|
255
|
+
"const": "public"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"type": "array",
|
|
259
|
+
"items": {
|
|
260
|
+
"type": "string"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"required": [
|
|
267
|
+
"kind"
|
|
268
|
+
],
|
|
269
|
+
"additionalProperties": false
|
|
185
270
|
},
|
|
186
271
|
{
|
|
187
|
-
"type": "
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
|
|
272
|
+
"type": "object",
|
|
273
|
+
"properties": {
|
|
274
|
+
"kind": {
|
|
275
|
+
"type": "string",
|
|
276
|
+
"const": "nested"
|
|
277
|
+
},
|
|
278
|
+
"into": {
|
|
279
|
+
"type": "string"
|
|
280
|
+
},
|
|
281
|
+
"docsPath": {
|
|
282
|
+
"type": "string"
|
|
283
|
+
},
|
|
284
|
+
"group": {
|
|
285
|
+
"type": "string"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"required": [
|
|
289
|
+
"kind",
|
|
290
|
+
"into"
|
|
291
|
+
],
|
|
292
|
+
"additionalProperties": false
|
|
191
293
|
}
|
|
192
294
|
]
|
|
193
|
-
},
|
|
194
|
-
"injectInto": {
|
|
195
|
-
"type": "string"
|
|
196
|
-
},
|
|
197
|
-
"docsPath": {
|
|
198
|
-
"type": "string"
|
|
199
295
|
}
|
|
200
296
|
},
|
|
201
297
|
"required": [
|
|
202
298
|
"name",
|
|
203
299
|
"description",
|
|
204
|
-
"status"
|
|
300
|
+
"status",
|
|
301
|
+
"source",
|
|
302
|
+
"placement"
|
|
205
303
|
],
|
|
206
304
|
"additionalProperties": false
|
|
207
305
|
}
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
} from "./chunk-SCZZB7OE.js";
|
|
9
9
|
import {
|
|
10
10
|
clearifyPlugin
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-RW4IKHY4.js";
|
|
12
12
|
import {
|
|
13
13
|
loadUserConfig,
|
|
14
14
|
resolveConfig,
|
|
15
15
|
resolveSections
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PGTNVDNF.js";
|
|
17
17
|
import {
|
|
18
18
|
buildSectionData
|
|
19
19
|
} from "./chunk-CTL4YL7C.js";
|
|
@@ -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-QB73GUF2.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-QB73GUF2.js");
|
|
302
302
|
await registerWithHub({
|
|
303
303
|
projectName: detectProjectName(),
|
|
304
304
|
hubToken: options.hubToken,
|
|
@@ -42,28 +42,44 @@ var OpenAPIConfigSchema = z.object({
|
|
|
42
42
|
basePath: z.string().default("/api"),
|
|
43
43
|
generatePages: z.boolean().default(true)
|
|
44
44
|
}).optional();
|
|
45
|
+
var HubProjectSourceSchema = z.discriminatedUnion("kind", [
|
|
46
|
+
z.object({ kind: z.literal("none") }),
|
|
47
|
+
z.object({
|
|
48
|
+
kind: z.literal("git"),
|
|
49
|
+
repo: z.string(),
|
|
50
|
+
ref: z.string().optional(),
|
|
51
|
+
path: z.string().optional(),
|
|
52
|
+
sparse: z.boolean().optional()
|
|
53
|
+
}),
|
|
54
|
+
z.object({ kind: z.literal("url"), url: z.string() }),
|
|
55
|
+
z.object({ kind: z.literal("inline"), markdown: z.string() })
|
|
56
|
+
]);
|
|
57
|
+
var HubProjectPlacementSchema = z.discriminatedUnion("kind", [
|
|
58
|
+
z.object({ kind: z.literal("card"), href: z.string() }),
|
|
59
|
+
z.object({
|
|
60
|
+
kind: z.literal("tab"),
|
|
61
|
+
sections: z.union([z.literal("all"), z.literal("public"), z.array(z.string())]).optional()
|
|
62
|
+
}),
|
|
63
|
+
z.object({
|
|
64
|
+
kind: z.literal("nested"),
|
|
65
|
+
into: z.string(),
|
|
66
|
+
docsPath: z.string().optional(),
|
|
67
|
+
group: z.string().optional()
|
|
68
|
+
})
|
|
69
|
+
]);
|
|
45
70
|
var HubProjectSchema = z.object({
|
|
46
71
|
name: z.string(),
|
|
47
72
|
description: z.string(),
|
|
48
|
-
href: z.string().optional(),
|
|
49
73
|
repo: z.string().optional(),
|
|
50
74
|
status: z.enum(["active", "beta", "planned", "deprecated"]).default("active"),
|
|
51
75
|
icon: z.string().optional(),
|
|
52
76
|
tags: z.array(z.string()).optional(),
|
|
53
77
|
group: z.string().optional(),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
embedSections: z.union([
|
|
57
|
-
z.literal("all"),
|
|
58
|
-
z.literal("public"),
|
|
59
|
-
z.array(z.string())
|
|
60
|
-
]).optional(),
|
|
61
|
-
injectInto: z.string().optional(),
|
|
62
|
-
docsPath: z.string().optional()
|
|
78
|
+
source: HubProjectSourceSchema,
|
|
79
|
+
placement: HubProjectPlacementSchema
|
|
63
80
|
});
|
|
64
81
|
var HubProjectPartialSchema = z.object({
|
|
65
82
|
description: z.string(),
|
|
66
|
-
href: z.string().optional(),
|
|
67
83
|
repo: z.string().optional(),
|
|
68
84
|
status: z.enum(["active", "beta", "planned", "deprecated"]).default("active"),
|
|
69
85
|
icon: z.string().optional(),
|
|
@@ -335,8 +351,14 @@ function buildStagingOverlay(stagingDir, originalDir, injections) {
|
|
|
335
351
|
symlinkSync(sourcePath, destPath);
|
|
336
352
|
}
|
|
337
353
|
}
|
|
354
|
+
function isReservedSource(source) {
|
|
355
|
+
return source.kind === "url" || source.kind === "inline";
|
|
356
|
+
}
|
|
338
357
|
async function scanHubProjects(config, root) {
|
|
339
|
-
|
|
358
|
+
const hasGitTabOrNested = config.hub?.projects?.some(
|
|
359
|
+
(p) => p.source.kind === "git" && (p.placement.kind === "tab" || p.placement.kind === "nested")
|
|
360
|
+
) ?? false;
|
|
361
|
+
if (!config.hub?.scan && !hasGitTabOrNested) {
|
|
340
362
|
return config;
|
|
341
363
|
}
|
|
342
364
|
const scannedProjects = [];
|
|
@@ -350,15 +372,17 @@ async function scanHubProjects(config, root) {
|
|
|
350
372
|
if (!childConfig.hubProject) continue;
|
|
351
373
|
const name = childConfig.name ?? basename(dirname(configPath));
|
|
352
374
|
const hp = childConfig.hubProject;
|
|
375
|
+
const href = childConfig.siteUrl;
|
|
353
376
|
scannedProjects.push({
|
|
354
377
|
name,
|
|
355
378
|
description: hp.description,
|
|
356
|
-
href: hp.href ?? childConfig.siteUrl,
|
|
357
379
|
repo: hp.repo,
|
|
358
380
|
status: hp.status,
|
|
359
381
|
icon: hp.icon,
|
|
360
382
|
tags: hp.tags,
|
|
361
|
-
group: hp.group
|
|
383
|
+
group: hp.group,
|
|
384
|
+
source: { kind: "none" },
|
|
385
|
+
placement: { kind: "card", href: href ?? "#" }
|
|
362
386
|
});
|
|
363
387
|
} catch {
|
|
364
388
|
}
|
|
@@ -369,18 +393,26 @@ async function scanHubProjects(config, root) {
|
|
|
369
393
|
...scannedProjects.filter((p) => !manualNames.has(p.name)),
|
|
370
394
|
...config.hub?.projects ?? []
|
|
371
395
|
];
|
|
396
|
+
for (const project of merged) {
|
|
397
|
+
if (isReservedSource(project.source)) {
|
|
398
|
+
throw new Error(
|
|
399
|
+
`Hub project "${project.name}": source.kind "${project.source.kind}" is reserved and not implemented. Use source.kind "none" or "git".`
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
372
403
|
const embedSections = [];
|
|
373
404
|
for (const project of merged) {
|
|
374
|
-
if (project.
|
|
405
|
+
if (project.source.kind !== "git" || project.placement.kind !== "tab") continue;
|
|
375
406
|
const cacheDir = config.hub?.cacheDir ? resolve(root, config.hub.cacheDir) : resolve(root, "node_modules/.cache/clearify-remote");
|
|
376
407
|
try {
|
|
377
408
|
const { resolveRemoteSource } = await import("./core/remote.js");
|
|
378
|
-
const {
|
|
409
|
+
const { kind: _kind, ...gitSource } = project.source;
|
|
410
|
+
const { localPath } = await resolveRemoteSource(gitSource, cacheDir);
|
|
379
411
|
const remoteConfig = await loadUserConfig(localPath);
|
|
380
412
|
const remoteSections = remoteConfig.sections ?? [
|
|
381
413
|
{ label: remoteConfig.name ?? project.name, docsDir: remoteConfig.docsDir ?? "./docs" }
|
|
382
414
|
];
|
|
383
|
-
const filter = project.
|
|
415
|
+
const filter = project.placement.sections ?? "public";
|
|
384
416
|
const filtered = remoteSections.filter((s) => {
|
|
385
417
|
if (filter === "all") return true;
|
|
386
418
|
if (filter === "public") return !s.draft;
|
|
@@ -400,46 +432,44 @@ async function scanHubProjects(config, root) {
|
|
|
400
432
|
exclude: s.exclude
|
|
401
433
|
});
|
|
402
434
|
}
|
|
403
|
-
console.log(` Hub
|
|
435
|
+
console.log(` Hub tab "${project.name}": ${filtered.length} sections pulled`);
|
|
404
436
|
} catch (err) {
|
|
405
437
|
console.warn(
|
|
406
|
-
`
|
|
438
|
+
` Hub tab "${project.name}" failed:`,
|
|
407
439
|
err instanceof Error ? err.message : err
|
|
408
440
|
);
|
|
409
441
|
}
|
|
410
442
|
}
|
|
411
443
|
const injectionsBySection = /* @__PURE__ */ new Map();
|
|
412
444
|
for (const project of merged) {
|
|
413
|
-
if (project.
|
|
445
|
+
if (project.source.kind !== "git" || project.placement.kind !== "nested") continue;
|
|
414
446
|
const cacheDir = config.hub?.cacheDir ? resolve(root, config.hub.cacheDir) : resolve(root, "node_modules/.cache/clearify-remote");
|
|
415
447
|
try {
|
|
416
448
|
const { resolveRemoteSource } = await import("./core/remote.js");
|
|
417
|
-
const {
|
|
418
|
-
const
|
|
449
|
+
const { kind: _kind, ...gitSource } = project.source;
|
|
450
|
+
const { localPath, cached } = await resolveRemoteSource(gitSource, cacheDir);
|
|
451
|
+
const docsPath = project.placement.docsPath ?? "docs";
|
|
419
452
|
const absoluteDocsPath = resolve(localPath, docsPath);
|
|
420
453
|
if (!existsSync(absoluteDocsPath)) {
|
|
421
454
|
console.warn(
|
|
422
|
-
`
|
|
455
|
+
` Hub nested "${project.name}": docs path "${docsPath}" not found in cloned repo.`
|
|
423
456
|
);
|
|
424
457
|
continue;
|
|
425
458
|
}
|
|
426
|
-
const targetLabel = project.
|
|
427
|
-
if (!targetLabel) {
|
|
428
|
-
console.warn(` \u26A0 Hub inject "${project.name}": missing injectInto field.`);
|
|
429
|
-
continue;
|
|
430
|
-
}
|
|
459
|
+
const targetLabel = project.placement.into;
|
|
431
460
|
if (!injectionsBySection.has(targetLabel)) {
|
|
432
461
|
injectionsBySection.set(targetLabel, /* @__PURE__ */ new Map());
|
|
433
462
|
}
|
|
434
463
|
const slugifiedName = slugify(project.name);
|
|
435
|
-
const
|
|
464
|
+
const groupSeg = project.placement.group;
|
|
465
|
+
const relPath = groupSeg ? `projects/${groupSeg}/${slugifiedName}` : `projects/${slugifiedName}`;
|
|
436
466
|
injectionsBySection.get(targetLabel).set(relPath, absoluteDocsPath);
|
|
437
467
|
console.log(
|
|
438
|
-
` Hub
|
|
468
|
+
` Hub nested "${project.name}": ${cached ? "cached" : "cloned"} to ${relPath}`
|
|
439
469
|
);
|
|
440
470
|
} catch (err) {
|
|
441
471
|
console.warn(
|
|
442
|
-
`
|
|
472
|
+
` Hub nested "${project.name}" failed:`,
|
|
443
473
|
err instanceof Error ? err.message : err
|
|
444
474
|
);
|
|
445
475
|
}
|
|
@@ -37,7 +37,6 @@ declare const ClearifyDataSchema: z.ZodObject<{
|
|
|
37
37
|
projects: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
38
38
|
name: z.ZodString;
|
|
39
39
|
description: z.ZodString;
|
|
40
|
-
href: z.ZodOptional<z.ZodString>;
|
|
41
40
|
repo: z.ZodOptional<z.ZodString>;
|
|
42
41
|
status: z.ZodDefault<z.ZodEnum<{
|
|
43
42
|
active: "active";
|
|
@@ -48,20 +47,33 @@ declare const ClearifyDataSchema: z.ZodObject<{
|
|
|
48
47
|
icon: z.ZodOptional<z.ZodString>;
|
|
49
48
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
49
|
group: z.ZodOptional<z.ZodString>;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}>>;
|
|
56
|
-
git: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
51
|
+
kind: z.ZodLiteral<"none">;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"git">;
|
|
57
54
|
repo: z.ZodString;
|
|
58
55
|
ref: z.ZodOptional<z.ZodString>;
|
|
59
56
|
path: z.ZodOptional<z.ZodString>;
|
|
60
57
|
sparse: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
-
}, z.core.$strip
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"url">;
|
|
60
|
+
url: z.ZodString;
|
|
61
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
62
|
+
kind: z.ZodLiteral<"inline">;
|
|
63
|
+
markdown: z.ZodString;
|
|
64
|
+
}, z.core.$strip>], "kind">;
|
|
65
|
+
placement: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
66
|
+
kind: z.ZodLiteral<"card">;
|
|
67
|
+
href: z.ZodString;
|
|
68
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
+
kind: z.ZodLiteral<"tab">;
|
|
70
|
+
sections: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"public">, z.ZodArray<z.ZodString>]>>;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
kind: z.ZodLiteral<"nested">;
|
|
73
|
+
into: z.ZodString;
|
|
74
|
+
docsPath: z.ZodOptional<z.ZodString>;
|
|
75
|
+
group: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>], "kind">;
|
|
65
77
|
}, z.core.$strip>>>;
|
|
66
78
|
scan: z.ZodOptional<z.ZodString>;
|
|
67
79
|
cacheDir: z.ZodOptional<z.ZodString>;
|
package/dist/node/core/config.js
CHANGED
|
@@ -79,6 +79,7 @@ async function secretExists(token, owner, repo, name) {
|
|
|
79
79
|
const res = await ghApiFetch(url, { headers: { Authorization: `token ${token}` } });
|
|
80
80
|
return res.status === 200;
|
|
81
81
|
}
|
|
82
|
+
var __internal = { encryptSecret };
|
|
82
83
|
async function promptSecretMode() {
|
|
83
84
|
const { createInterface } = await import("readline");
|
|
84
85
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -212,12 +213,13 @@ async function updateHubRegistry(token, hub, project) {
|
|
|
212
213
|
name: project.name,
|
|
213
214
|
description: project.description,
|
|
214
215
|
status: "active",
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
source: {
|
|
217
|
+
kind: "git",
|
|
217
218
|
repo: project.gitRepoUrl,
|
|
218
219
|
ref: project.gitRef,
|
|
219
220
|
path: project.docsPath
|
|
220
|
-
}
|
|
221
|
+
},
|
|
222
|
+
placement: { kind: "tab" }
|
|
221
223
|
};
|
|
222
224
|
if (existingIdx >= 0) {
|
|
223
225
|
currentData.hub.projects[existingIdx] = entry;
|
|
@@ -310,9 +312,15 @@ jobs:
|
|
|
310
312
|
}
|
|
311
313
|
async function registerWithHub(options) {
|
|
312
314
|
const clientId = process.env.CLEARIFY_GITHUB_CLIENT_ID;
|
|
313
|
-
if (!clientId) {
|
|
314
|
-
console.error("\n Error:
|
|
315
|
-
console.error("
|
|
315
|
+
if (!clientId && !options.hubToken) {
|
|
316
|
+
console.error("\n Error: no GitHub credentials available for hub onboarding.");
|
|
317
|
+
console.error(" Clearify needs one of these to write the hub registry entry:\n");
|
|
318
|
+
console.error(" 1) Set CLEARIFY_GITHUB_CLIENT_ID to a GitHub OAuth App client ID");
|
|
319
|
+
console.error(" (create one at https://github.com/settings/applications/new,");
|
|
320
|
+
console.error(' scope "repo"), then re-run this command.');
|
|
321
|
+
console.error(" 2) Pass --hub-token <pat> to use a Personal Access Token directly");
|
|
322
|
+
console.error(' (fine-grained PAT with "Contents: Read and Write" on the hub repo).');
|
|
323
|
+
console.error("");
|
|
316
324
|
process.exit(1);
|
|
317
325
|
}
|
|
318
326
|
const projectName = options.projectName ?? detectProjectName();
|
|
@@ -328,8 +336,14 @@ async function registerWithHub(options) {
|
|
|
328
336
|
const hub = await promptHubRepo();
|
|
329
337
|
console.log(` Hub: ${hub.owner}/${hub.repo}
|
|
330
338
|
`);
|
|
331
|
-
|
|
332
|
-
|
|
339
|
+
let token;
|
|
340
|
+
if (options.hubToken) {
|
|
341
|
+
console.log(" Using provided --hub-token for GitHub API calls.");
|
|
342
|
+
token = options.hubToken;
|
|
343
|
+
} else {
|
|
344
|
+
console.log(" Starting GitHub authentication...");
|
|
345
|
+
token = await githubDeviceAuth(clientId);
|
|
346
|
+
}
|
|
333
347
|
console.log(" Updating hub registry...");
|
|
334
348
|
await updateHubRegistry(token, hub, {
|
|
335
349
|
name: projectName,
|
|
@@ -384,5 +398,6 @@ function printSuccessFooter(currentRepo) {
|
|
|
384
398
|
`);
|
|
385
399
|
}
|
|
386
400
|
export {
|
|
401
|
+
__internal,
|
|
387
402
|
registerWithHub
|
|
388
403
|
};
|
package/dist/node/node/build.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildSite
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-BCEGDIR6.js";
|
|
4
4
|
import "../chunk-PRTER35L.js";
|
|
5
5
|
import "../chunk-SCZZB7OE.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-RW4IKHY4.js";
|
|
7
7
|
import "../chunk-B2Q23JW3.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-PGTNVDNF.js";
|
|
9
9
|
import "../chunk-AJBCHKBP.js";
|
|
10
10
|
import "../chunk-V7LLYIRO.js";
|
|
11
11
|
import "../chunk-CTL4YL7C.js";
|
package/dist/node/node/check.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkFrontmatter,
|
|
3
3
|
checkLinks
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-CK2SLBAG.js";
|
|
5
|
+
import "../chunk-PGTNVDNF.js";
|
|
6
6
|
import "../chunk-AJBCHKBP.js";
|
|
7
7
|
import "../chunk-V7LLYIRO.js";
|
|
8
8
|
import "../chunk-CTL4YL7C.js";
|
package/dist/node/node/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildSite
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-BCEGDIR6.js";
|
|
4
4
|
import {
|
|
5
5
|
remarkMermaidToComponent
|
|
6
6
|
} from "../chunk-PRTER35L.js";
|
|
7
7
|
import "../chunk-SCZZB7OE.js";
|
|
8
8
|
import {
|
|
9
9
|
clearifyPlugin
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-RW4IKHY4.js";
|
|
11
11
|
import "../chunk-B2Q23JW3.js";
|
|
12
12
|
import {
|
|
13
13
|
init
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-GPBEDIOY.js";
|
|
15
15
|
import {
|
|
16
16
|
checkFrontmatter,
|
|
17
17
|
checkLinks
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-CK2SLBAG.js";
|
|
19
19
|
import {
|
|
20
20
|
loadUserConfig,
|
|
21
21
|
resolveConfig
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-PGTNVDNF.js";
|
|
23
23
|
import "../chunk-AJBCHKBP.js";
|
|
24
24
|
import "../chunk-V7LLYIRO.js";
|
|
25
25
|
import "../chunk-CTL4YL7C.js";
|