@grove-dev/core 0.1.4 → 0.2.2
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/build-data.d.ts +22 -34
- package/dist/build-data.d.ts.map +1 -1
- package/dist/build-data.js +55 -74
- package/dist/build-data.js.map +1 -1
- package/dist/config.d.ts +15 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -5
- package/dist/config.js.map +1 -1
- package/dist/decisions.d.ts +15 -12
- package/dist/decisions.d.ts.map +1 -1
- package/dist/decisions.js +52 -32
- package/dist/decisions.js.map +1 -1
- package/dist/enrich.d.ts +2 -2
- package/dist/enrich.js +2 -2
- package/dist/importer.d.ts +3 -2
- package/dist/importer.d.ts.map +1 -1
- package/dist/importer.js +2 -23
- package/dist/importer.js.map +1 -1
- package/dist/llms.d.ts +6 -10
- package/dist/llms.d.ts.map +1 -1
- package/dist/llms.js +55 -44
- package/dist/llms.js.map +1 -1
- package/dist/markdown.d.ts +32 -10
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +95 -55
- package/dist/markdown.js.map +1 -1
- package/dist/schema.d.ts +1459 -555
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +398 -474
- package/dist/schema.js.map +1 -1
- package/dist/sitemap.d.ts +4 -13
- package/dist/sitemap.d.ts.map +1 -1
- package/dist/sitemap.js +10 -8
- package/dist/sitemap.js.map +1 -1
- package/dist/validate.d.ts +21 -2
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +127 -28
- package/dist/validate.js.map +1 -1
- package/package.json +1 -1
package/dist/llms.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface
|
|
1
|
+
import { type GroveConfig } from "./config.js";
|
|
2
|
+
export interface LlmsRecordInput {
|
|
3
3
|
slug: string;
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
@@ -7,7 +7,6 @@ export interface LlmsAppInput {
|
|
|
7
7
|
stack?: string;
|
|
8
8
|
stars?: number;
|
|
9
9
|
visibility?: string;
|
|
10
|
-
/** Detail page body — markdown. Used for llms-full.txt sections. */
|
|
11
10
|
detail?: string;
|
|
12
11
|
homepageUrl?: string;
|
|
13
12
|
repoUrl?: string;
|
|
@@ -18,17 +17,14 @@ export interface LlmsAppInput {
|
|
|
18
17
|
export interface LlmsInput {
|
|
19
18
|
siteUrl?: string;
|
|
20
19
|
generatedAt: string;
|
|
21
|
-
|
|
20
|
+
records: LlmsRecordInput[];
|
|
22
21
|
}
|
|
23
22
|
export interface LlmsResult {
|
|
24
23
|
txtPath: string;
|
|
25
24
|
fullPath: string;
|
|
26
25
|
indexed: number;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
export declare function
|
|
30
|
-
|
|
31
|
-
export declare function buildLlmsFullTxt(input: LlmsInput, config: CuratedConfig): string;
|
|
32
|
-
/** Write public/llms.txt and public/llms-full.txt. */
|
|
33
|
-
export declare function buildLlmsFiles(input: LlmsInput, cwd?: string, config?: CuratedConfig): Promise<LlmsResult>;
|
|
27
|
+
export declare function buildLlmsTxt(input: LlmsInput, config: GroveConfig): string;
|
|
28
|
+
export declare function buildLlmsFullTxt(input: LlmsInput, config: GroveConfig): string;
|
|
29
|
+
export declare function buildLlmsFiles(input: LlmsInput, cwd?: string, config?: GroveConfig): Promise<LlmsResult>;
|
|
34
30
|
//# sourceMappingURL=llms.d.ts.map
|
package/dist/llms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llms.d.ts","sourceRoot":"","sources":["../src/llms.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"llms.d.ts","sourceRoot":"","sources":["../src/llms.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,aAAa,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AA4DD,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CAkB1E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,CA4B9E;AAED,wBAAsB,cAAc,CAClC,KAAK,EAAE,SAAS,EAChB,GAAG,SAAgB,EACnB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAerB"}
|
package/dist/llms.js
CHANGED
|
@@ -1,90 +1,101 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
3
|
import { loadConfig } from "./config.js";
|
|
4
|
+
const BLUEPRINT_INDEX = {
|
|
5
|
+
"project-directory": "projects",
|
|
6
|
+
"resource-hub": "resources",
|
|
7
|
+
"ecosystem-map": "entities",
|
|
8
|
+
};
|
|
9
|
+
const BLUEPRINT_PLURAL = {
|
|
10
|
+
"project-directory": "Projects",
|
|
11
|
+
"resource-hub": "Resources",
|
|
12
|
+
"ecosystem-map": "Entities",
|
|
13
|
+
};
|
|
4
14
|
function slug(value) {
|
|
5
|
-
return String(value)
|
|
15
|
+
return String(value)
|
|
16
|
+
.toLowerCase()
|
|
17
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
18
|
+
.replace(/^-+|-+$/g, "");
|
|
6
19
|
}
|
|
7
20
|
function truncate(value, max) {
|
|
8
21
|
return value.replace(/\s+/g, " ").slice(0, max);
|
|
9
22
|
}
|
|
10
|
-
function buildIndexLine(
|
|
11
|
-
const desc = truncate(
|
|
12
|
-
const cat =
|
|
13
|
-
const stack =
|
|
14
|
-
const stars =
|
|
15
|
-
return `- [${
|
|
23
|
+
function buildIndexLine(record) {
|
|
24
|
+
const desc = truncate(record.description ?? "", 120);
|
|
25
|
+
const cat = record.category ?? "—";
|
|
26
|
+
const stack = record.stack ?? "—";
|
|
27
|
+
const stars = record.stars ?? 0;
|
|
28
|
+
return `- [${record.name}](#${slug(record.slug)}) — ${cat} · ${stack} · ${stars}★ — ${desc}`;
|
|
16
29
|
}
|
|
17
|
-
function buildDetailSection(
|
|
30
|
+
function buildDetailSection(record, siteUrl, indexSlug) {
|
|
18
31
|
const lines = [
|
|
19
|
-
`### ${
|
|
32
|
+
`### ${record.name}`,
|
|
20
33
|
"",
|
|
21
|
-
|
|
34
|
+
record.description ? `${record.description}` : "",
|
|
22
35
|
"",
|
|
23
|
-
`- slug: ${
|
|
24
|
-
`- category: ${
|
|
25
|
-
`- stack: ${
|
|
26
|
-
`- stars: ${
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
`- url: ${siteUrl}/${indexSlug}/${
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
`- slug: ${record.slug}`,
|
|
37
|
+
`- category: ${record.category ?? "—"}`,
|
|
38
|
+
`- stack: ${record.stack ?? "—"}`,
|
|
39
|
+
`- stars: ${record.stars ?? 0}`,
|
|
40
|
+
record.license ? `- license: ${record.license}` : "",
|
|
41
|
+
record.repoUrl ? `- repo: ${record.repoUrl}` : "",
|
|
42
|
+
record.homepageUrl ? `- homepage: ${record.homepageUrl}` : "",
|
|
43
|
+
`- url: ${siteUrl}/${indexSlug}/${record.slug}`,
|
|
44
|
+
record.lastCommitAt ? `- lastCommit: ${record.lastCommitAt.slice(0, 10)}` : "",
|
|
45
|
+
record.addedAt ? `- added: ${record.addedAt.slice(0, 10)}` : "",
|
|
33
46
|
].filter(Boolean);
|
|
34
|
-
if (
|
|
35
|
-
lines.push("", "#### Detail", "",
|
|
47
|
+
if (record.detail) {
|
|
48
|
+
lines.push("", "#### Detail", "", record.detail);
|
|
36
49
|
}
|
|
37
50
|
return lines.join("\n");
|
|
38
51
|
}
|
|
39
|
-
/** Build the llms.txt string — short pointer to llms-full.txt. */
|
|
40
52
|
export function buildLlmsTxt(input, config) {
|
|
41
|
-
const siteUrl = (input.siteUrl ?? config.
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
return `# ${config.name}
|
|
53
|
+
const siteUrl = (input.siteUrl ?? config.site.url ?? "").replace(/\/$/, "");
|
|
54
|
+
const indexSlug = BLUEPRINT_INDEX[config.blueprint] ?? "items";
|
|
55
|
+
const visible = input.records.filter((r) => r.visibility !== "hide" && r.visibility !== "remove");
|
|
56
|
+
return `# ${config.site.name}
|
|
45
57
|
|
|
46
|
-
${config.description ?? config.tagline}
|
|
58
|
+
${config.site.description ?? config.site.tagline}
|
|
47
59
|
|
|
48
60
|
Directory: ${siteUrl}/${indexSlug}
|
|
49
|
-
|
|
50
|
-
Categories: ${new Set(visible.map((
|
|
61
|
+
Records indexed: ${visible.length}
|
|
62
|
+
Categories: ${new Set(visible.map((r) => r.category).filter(Boolean)).size}
|
|
51
63
|
|
|
52
64
|
## Usage
|
|
53
65
|
|
|
54
|
-
Use /llms-full.txt for
|
|
66
|
+
Use /llms-full.txt for record-level details. Prefer detail pages for citations.
|
|
55
67
|
`;
|
|
56
68
|
}
|
|
57
|
-
/** Build the llms-full.txt string — index + per-app sections. */
|
|
58
69
|
export function buildLlmsFullTxt(input, config) {
|
|
59
|
-
const siteUrl = (input.siteUrl ?? config.
|
|
60
|
-
const indexSlug = config.
|
|
61
|
-
const visible = input.
|
|
70
|
+
const siteUrl = (input.siteUrl ?? config.site.url ?? "").replace(/\/$/, "");
|
|
71
|
+
const indexSlug = BLUEPRINT_INDEX[config.blueprint] ?? "items";
|
|
72
|
+
const visible = input.records.filter((r) => r.visibility !== "hide" && r.visibility !== "remove");
|
|
73
|
+
const plural = BLUEPRINT_PLURAL[config.blueprint] ?? "Items";
|
|
62
74
|
const index = visible.map(buildIndexLine).join("\n");
|
|
63
75
|
const sections = visible
|
|
64
|
-
.map((
|
|
76
|
+
.map((record) => buildDetailSection(record, siteUrl, indexSlug))
|
|
65
77
|
.join("\n\n");
|
|
66
78
|
return [
|
|
67
|
-
`# ${config.name} — full directory`,
|
|
79
|
+
`# ${config.site.name} — full directory`,
|
|
68
80
|
"",
|
|
69
|
-
`> Generated ${input.generatedAt} from ${input.
|
|
70
|
-
`> Source: ${siteUrl}/${indexSlug} · Regenerate with \`grove
|
|
81
|
+
`> Generated ${input.generatedAt} from ${input.records.length} records.`,
|
|
82
|
+
`> Source: ${siteUrl}/${indexSlug} · Regenerate with \`grove generate\`.`,
|
|
71
83
|
"",
|
|
72
|
-
"Each section below mirrors one
|
|
84
|
+
"Each section below mirrors one record detail page.",
|
|
73
85
|
"",
|
|
74
86
|
"## Index",
|
|
75
87
|
"",
|
|
76
88
|
index,
|
|
77
89
|
"",
|
|
78
|
-
sections ?
|
|
90
|
+
sections ? `## ${plural}` : "",
|
|
79
91
|
"",
|
|
80
92
|
sections,
|
|
81
93
|
"",
|
|
82
94
|
].join("\n");
|
|
83
95
|
}
|
|
84
|
-
/** Write public/llms.txt and public/llms-full.txt. */
|
|
85
96
|
export async function buildLlmsFiles(input, cwd = process.cwd(), config) {
|
|
86
97
|
const cfg = config ?? (await loadConfig(cwd));
|
|
87
|
-
const publicDir = resolve(cwd,
|
|
98
|
+
const publicDir = resolve(cwd, cfg.paths.publicDir);
|
|
88
99
|
await mkdir(publicDir, { recursive: true });
|
|
89
100
|
const txtPath = join(publicDir, "llms.txt");
|
|
90
101
|
const fullPath = join(publicDir, "llms-full.txt");
|
|
@@ -93,7 +104,7 @@ export async function buildLlmsFiles(input, cwd = process.cwd(), config) {
|
|
|
93
104
|
return {
|
|
94
105
|
txtPath,
|
|
95
106
|
fullPath,
|
|
96
|
-
indexed: input.
|
|
107
|
+
indexed: input.records.filter((r) => r.visibility !== "hide" && r.visibility !== "remove").length,
|
|
97
108
|
};
|
|
98
109
|
}
|
|
99
110
|
//# sourceMappingURL=llms.js.map
|
package/dist/llms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llms.js","sourceRoot":"","sources":["../src/llms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"llms.js","sourceRoot":"","sources":["../src/llms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAoB,UAAU,EAAE,MAAM,aAAa,CAAC;AA8B3D,MAAM,eAAe,GAA2B;IAC9C,mBAAmB,EAAE,UAAU;IAC/B,cAAc,EAAE,WAAW;IAC3B,eAAe,EAAE,UAAU;CAC5B,CAAC;AAEF,MAAM,gBAAgB,GAA2B;IAC/C,mBAAmB,EAAE,UAAU;IAC/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AQ;QACR,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAC3B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,IAAI,CAAC,CAAC,UAAU,KAAK,QAAQ,CAC5D,CAAC,MAAM;KACT,CAAC;AACJ,CAAC"}
|
package/dist/markdown.d.ts
CHANGED
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { type Blueprint } from "./schema.js";
|
|
2
|
+
export interface ImportedRecord {
|
|
3
|
+
slug: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
category: string;
|
|
7
|
+
links: {
|
|
8
|
+
github?: string;
|
|
9
|
+
website?: string;
|
|
10
|
+
source?: string;
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
export interface ImportSummary {
|
|
14
|
+
imported: number;
|
|
15
|
+
skipped: number;
|
|
16
|
+
categories: string[];
|
|
17
|
+
duplicateSlugs: number;
|
|
18
|
+
tocSkipped: number;
|
|
19
|
+
anchorLinksSkipped: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ImportResult {
|
|
22
|
+
records: ImportedRecord[];
|
|
23
|
+
report: ImportSummary;
|
|
24
|
+
}
|
|
13
25
|
export declare function detectGithubRepo(url: string): string | undefined;
|
|
14
26
|
export declare function parseAwesomeMarkdown(text: string, options?: {
|
|
15
27
|
file?: string;
|
|
16
28
|
sourceUrl?: string;
|
|
17
29
|
}): ImportResult;
|
|
30
|
+
export declare function importAwesomeList(input: string): Promise<ImportResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Write imported records out as `data/records/<slug>.yml`, one per
|
|
33
|
+
* record. Each file is shaped for the `project-directory` blueprint
|
|
34
|
+
* (kind: project). Other blueprints should use a separate importer.
|
|
35
|
+
*/
|
|
36
|
+
export declare function writeImportedRecords(result: ImportResult, cwd?: string, blueprint?: Blueprint): Promise<{
|
|
37
|
+
written: number;
|
|
38
|
+
dir: string;
|
|
39
|
+
}>;
|
|
18
40
|
//# sourceMappingURL=markdown.d.ts.map
|
package/dist/markdown.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,SAAS,EAAsB,MAAM,aAAa,CAAC;AAEhF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/D;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,EAAE,aAAa,CAAC;CACvB;AA0BD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMhE;AA2CD,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAClD,YAAY,CAyGd;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAuB5E;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,YAAY,EACpB,GAAG,SAAgB,EACnB,SAAS,GAAE,SAA+B,GACzC,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CA+B3C"}
|
package/dist/markdown.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { basename, join, resolve } from "node:path";
|
|
3
|
+
import { stringify as stringifyYaml } from "yaml";
|
|
4
|
+
import { blueprintKind } from "./schema.js";
|
|
2
5
|
const markdownLinkPattern = /\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
|
|
3
6
|
const TOC_TITLES = new Set([
|
|
4
7
|
"contents",
|
|
@@ -8,20 +11,22 @@ const TOC_TITLES = new Set([
|
|
|
8
11
|
"license",
|
|
9
12
|
"contributors",
|
|
10
13
|
]);
|
|
14
|
+
const EMOJIS = /[\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}]/gu;
|
|
11
15
|
function stripAnchor(name) {
|
|
12
16
|
return name
|
|
13
17
|
.replace(/<a\s+name="[^"]+"><\/a>/gi, "")
|
|
14
18
|
.replace(/🔗/g, "")
|
|
15
|
-
.replace(
|
|
19
|
+
.replace(EMOJIS, "")
|
|
16
20
|
.replace(/\s+/g, " ")
|
|
17
21
|
.trim();
|
|
18
22
|
}
|
|
23
|
+
const REPO_RESERVED = new Set(["issues", "pulls", "stargazers", "network"]);
|
|
19
24
|
export function detectGithubRepo(url) {
|
|
20
25
|
const match = url.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/#?\s]+)(?:[/?#].*)?$/i);
|
|
21
26
|
if (!match)
|
|
22
27
|
return undefined;
|
|
23
28
|
const repo = match[2].replace(/\.git$/, "");
|
|
24
|
-
if (!repo ||
|
|
29
|
+
if (!repo || REPO_RESERVED.has(repo))
|
|
25
30
|
return undefined;
|
|
26
31
|
return `https://github.com/${match[1]}/${repo}`;
|
|
27
32
|
}
|
|
@@ -46,19 +51,30 @@ function headingDepth(line) {
|
|
|
46
51
|
function headingText(line) {
|
|
47
52
|
return stripAnchor(line.match(/^#{2,6}\s+(.+?)\s*$/)?.[1]?.trim() ?? "");
|
|
48
53
|
}
|
|
54
|
+
function slugify(label, seen) {
|
|
55
|
+
const base = label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) ||
|
|
56
|
+
"item";
|
|
57
|
+
const existing = seen.get(base) ?? 0;
|
|
58
|
+
seen.set(base, existing + 1);
|
|
59
|
+
return existing === 0 ? base : `${base}-${existing}`;
|
|
60
|
+
}
|
|
61
|
+
function githubReadmeUrl(input) {
|
|
62
|
+
const match = input.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/#?\s]+)\/?$/i);
|
|
63
|
+
if (!match)
|
|
64
|
+
return undefined;
|
|
65
|
+
return `https://raw.githubusercontent.com/${match[1]}/${match[2]}/HEAD/README.md`;
|
|
66
|
+
}
|
|
49
67
|
export function parseAwesomeMarkdown(text, options = {}) {
|
|
50
68
|
const lines = text.split(/\r?\n/);
|
|
51
69
|
const seen = new Map();
|
|
52
70
|
const categories = new Set();
|
|
53
|
-
const
|
|
71
|
+
const records = [];
|
|
54
72
|
let currentCategory = "uncategorized";
|
|
55
|
-
let categoryDepth = 2;
|
|
56
73
|
let skipped = 0;
|
|
57
74
|
let duplicateSlugs = 0;
|
|
58
75
|
let tocSkipped = 0;
|
|
59
76
|
let anchorLinksSkipped = 0;
|
|
60
77
|
let inTocBlock = false;
|
|
61
|
-
let consecutiveBlankLines = 0;
|
|
62
78
|
for (let index = 0; index < lines.length; index++) {
|
|
63
79
|
const line = lines[index] ?? "";
|
|
64
80
|
const depth = headingDepth(line);
|
|
@@ -67,31 +83,21 @@ export function parseAwesomeMarkdown(text, options = {}) {
|
|
|
67
83
|
inTocBlock = TOC_TITLES.has(title.toLowerCase());
|
|
68
84
|
if (title && !inTocBlock) {
|
|
69
85
|
currentCategory = title;
|
|
70
|
-
categoryDepth = depth;
|
|
71
86
|
categories.add(currentCategory);
|
|
72
87
|
}
|
|
73
|
-
consecutiveBlankLines = 0;
|
|
74
88
|
continue;
|
|
75
89
|
}
|
|
76
90
|
if (inTocBlock) {
|
|
77
|
-
|
|
78
|
-
if (!line.trim()) {
|
|
79
|
-
consecutiveBlankLines++;
|
|
91
|
+
if (!line.trim())
|
|
80
92
|
continue;
|
|
81
|
-
}
|
|
82
93
|
if (/^\s*[-*+]\s+/.test(line) || /^\s*\d+\.\s+/.test(line)) {
|
|
83
94
|
tocSkipped++;
|
|
84
|
-
consecutiveBlankLines = 0;
|
|
85
95
|
continue;
|
|
86
96
|
}
|
|
87
|
-
// First non-list, non-blank line ends the TOC block.
|
|
88
97
|
inTocBlock = false;
|
|
89
98
|
}
|
|
90
|
-
if (!/^\s*[-*+]\s+/.test(line))
|
|
91
|
-
consecutiveBlankLines = line.trim() ? 0 : consecutiveBlankLines + 1;
|
|
99
|
+
if (!/^\s*[-*+]\s+/.test(line))
|
|
92
100
|
continue;
|
|
93
|
-
}
|
|
94
|
-
consecutiveBlankLines = 0;
|
|
95
101
|
const body = line.replace(/^\s*[-*+]\s+/, "").trim();
|
|
96
102
|
const parsedLinks = [...body.matchAll(markdownLinkPattern)].map((match) => ({
|
|
97
103
|
label: match[1].trim(),
|
|
@@ -101,7 +107,6 @@ export function parseAwesomeMarkdown(text, options = {}) {
|
|
|
101
107
|
skipped++;
|
|
102
108
|
continue;
|
|
103
109
|
}
|
|
104
|
-
// Filter out items whose primary link is an in-page anchor (TOC-style leftover).
|
|
105
110
|
const primary = parsedLinks[0];
|
|
106
111
|
if (!primary) {
|
|
107
112
|
skipped++;
|
|
@@ -111,66 +116,45 @@ export function parseAwesomeMarkdown(text, options = {}) {
|
|
|
111
116
|
anchorLinksSkipped++;
|
|
112
117
|
continue;
|
|
113
118
|
}
|
|
114
|
-
// Only keep items that have at least one external URL (HTTP/HTTPS or protocol-relative).
|
|
115
|
-
// Project directories need a real link, not just text + bare words.
|
|
116
119
|
const hasExternal = parsedLinks.some((link) => isExternalUrl(link.url) && !isAnchorLink(link.url));
|
|
117
120
|
if (!hasExternal) {
|
|
118
121
|
skipped++;
|
|
119
122
|
continue;
|
|
120
123
|
}
|
|
121
|
-
// Prefer the first external link as the primary, ignoring any leading anchor links.
|
|
122
124
|
const primaryExternal = parsedLinks.find((link) => isExternalUrl(link.url) && !isAnchorLink(link.url));
|
|
123
125
|
if (!primaryExternal) {
|
|
124
126
|
skipped++;
|
|
125
127
|
continue;
|
|
126
128
|
}
|
|
127
|
-
const github = parsedLinks
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
const github = parsedLinks
|
|
130
|
+
.map((link) => detectGithubRepo(link.url))
|
|
131
|
+
.find((u) => Boolean(u));
|
|
132
|
+
const id = slugify(primaryExternal.label, seen);
|
|
133
|
+
const lowerSlug = primaryExternal.label
|
|
134
|
+
.toLowerCase()
|
|
135
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
136
|
+
.replace(/^-+|-+$/g, "")
|
|
137
|
+
.slice(0, 80) || "item";
|
|
138
|
+
if (id !== lowerSlug)
|
|
131
139
|
duplicateSlugs++;
|
|
132
|
-
}
|
|
133
140
|
const description = extractDescription(body);
|
|
134
141
|
const links = {
|
|
135
142
|
...(github ? { github } : {}),
|
|
136
143
|
...(!github ? { website: primaryExternal.url } : {}),
|
|
137
144
|
...(options.sourceUrl ? { source: options.sourceUrl } : {}),
|
|
138
145
|
};
|
|
139
|
-
|
|
140
|
-
id,
|
|
146
|
+
records.push({
|
|
147
|
+
slug: id,
|
|
141
148
|
name: primaryExternal.label,
|
|
142
149
|
description: description || primaryExternal.label,
|
|
150
|
+
category: currentCategory,
|
|
143
151
|
links,
|
|
144
|
-
source: {
|
|
145
|
-
type: "markdown",
|
|
146
|
-
file: options.file,
|
|
147
|
-
line: index + 1,
|
|
148
|
-
url: options.sourceUrl,
|
|
149
|
-
},
|
|
150
|
-
taxonomy: {
|
|
151
|
-
category: currentCategory,
|
|
152
|
-
tags: [],
|
|
153
|
-
stacks: [],
|
|
154
|
-
platforms: [],
|
|
155
|
-
},
|
|
156
|
-
labels: [],
|
|
157
|
-
lenses: [],
|
|
158
|
-
distribution: {
|
|
159
|
-
channels: [],
|
|
160
|
-
},
|
|
161
|
-
curation: {
|
|
162
|
-
bestFor: [],
|
|
163
|
-
whyListed: [],
|
|
164
|
-
caveats: [],
|
|
165
|
-
launchAsk: [],
|
|
166
|
-
scores: {},
|
|
167
|
-
},
|
|
168
152
|
});
|
|
169
153
|
}
|
|
170
154
|
return {
|
|
171
|
-
|
|
155
|
+
records,
|
|
172
156
|
report: {
|
|
173
|
-
imported:
|
|
157
|
+
imported: records.length,
|
|
174
158
|
skipped,
|
|
175
159
|
categories: [...categories].filter((c) => c && c !== "uncategorized"),
|
|
176
160
|
duplicateSlugs,
|
|
@@ -179,4 +163,60 @@ export function parseAwesomeMarkdown(text, options = {}) {
|
|
|
179
163
|
},
|
|
180
164
|
};
|
|
181
165
|
}
|
|
166
|
+
export async function importAwesomeList(input) {
|
|
167
|
+
const remote = githubReadmeUrl(input) ?? (/^https?:\/\//.test(input) ? input : undefined);
|
|
168
|
+
let text;
|
|
169
|
+
let file;
|
|
170
|
+
let sourceUrl;
|
|
171
|
+
if (remote) {
|
|
172
|
+
const response = await fetch(remote);
|
|
173
|
+
if (!response.ok) {
|
|
174
|
+
throw new Error(`Could not fetch ${remote}: ${response.status} ${response.statusText}`);
|
|
175
|
+
}
|
|
176
|
+
text = await response.text();
|
|
177
|
+
file = "sources/README.md";
|
|
178
|
+
sourceUrl = input;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
const path = resolve(input);
|
|
182
|
+
const { readFile } = await import("node:fs/promises");
|
|
183
|
+
text = await readFile(path, "utf8");
|
|
184
|
+
file = basename(path);
|
|
185
|
+
}
|
|
186
|
+
return parseAwesomeMarkdown(text, { file, sourceUrl });
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Write imported records out as `data/records/<slug>.yml`, one per
|
|
190
|
+
* record. Each file is shaped for the `project-directory` blueprint
|
|
191
|
+
* (kind: project). Other blueprints should use a separate importer.
|
|
192
|
+
*/
|
|
193
|
+
export async function writeImportedRecords(result, cwd = process.cwd(), blueprint = "project-directory") {
|
|
194
|
+
const expectedKind = blueprintKind[blueprint];
|
|
195
|
+
const dir = resolve(cwd, "data", "records");
|
|
196
|
+
await mkdir(dir, { recursive: true });
|
|
197
|
+
let written = 0;
|
|
198
|
+
for (const record of result.records) {
|
|
199
|
+
let yamlObj;
|
|
200
|
+
if (expectedKind === "project") {
|
|
201
|
+
const project = {
|
|
202
|
+
kind: "project",
|
|
203
|
+
slug: record.slug,
|
|
204
|
+
name: record.name,
|
|
205
|
+
description: record.description,
|
|
206
|
+
category: record.category,
|
|
207
|
+
tags: [],
|
|
208
|
+
links: record.links,
|
|
209
|
+
source: { type: "import" },
|
|
210
|
+
};
|
|
211
|
+
yamlObj = project;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
yamlObj = { ...record, kind: expectedKind };
|
|
215
|
+
}
|
|
216
|
+
const path = join(dir, `${record.slug}.yml`);
|
|
217
|
+
await writeFile(path, stringifyYaml(yamlObj, { lineWidth: 100 }), "utf8");
|
|
218
|
+
written++;
|
|
219
|
+
}
|
|
220
|
+
return { written, dir };
|
|
221
|
+
}
|
|
182
222
|
//# sourceMappingURL=markdown.js.map
|
package/dist/markdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"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