faf 8.8.0 → 8.10.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/README.md +23 -164
- package/dist/cli.js +346 -337
- package/dist/cli.js.map +1 -263
- package/dist/core/dot-path.d.ts +23 -0
- package/dist/core/faf-dna.d.ts +24 -22
- package/dist/core/interview.d.ts +18 -6
- package/dist/core/safe-write.d.ts +3 -1
- package/dist/core/suggest.d.ts +55 -0
- package/dist/detect/assemble.d.ts +4 -2
- package/dist/detect/relentless.d.ts +3 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +177 -176
- package/dist/index.js.map +1 -143
- package/dist/interop/faf.d.ts +1 -1
- package/dist/interrogate/readme.d.ts +9 -0
- package/dist/interrogate/types.d.ts +34 -0
- package/dist/pack.js.map +1 -60
- package/package.json +8 -7
- package/project.faf +6 -6
package/dist/interop/faf.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare function updateFafFile(path: string, mutate: (doc: Document) => v
|
|
|
76
76
|
/** Options for {@link writeFaf}. */
|
|
77
77
|
export interface WriteFafOptions {
|
|
78
78
|
/** Write a fresh file from `data` even when one exists — the explicit
|
|
79
|
-
* overwrite (`faf init --force`, `faf git --force`). Default: an existing
|
|
79
|
+
* overwrite (`faf init --new` / `--force`, `faf git --force`). Default: an existing
|
|
80
80
|
* file is updated in place with {@link updateFafFile}. */
|
|
81
81
|
replace?: boolean;
|
|
82
82
|
/** Called for each alias of an existing file that `data` would change
|
|
@@ -23,3 +23,12 @@ export declare function extractWhen(content: string): string | undefined;
|
|
|
23
23
|
export declare function extractHow(content: string): string | undefined;
|
|
24
24
|
/** Read README.md and extract per-slot content. Returns {} if no README. */
|
|
25
25
|
export declare function interrogateReadme(dir: string): ExtractedContext;
|
|
26
|
+
/** A README find with where it came from: `README.md § Status`. */
|
|
27
|
+
export interface ReadmeFind {
|
|
28
|
+
value: string;
|
|
29
|
+
source: string;
|
|
30
|
+
}
|
|
31
|
+
/** The README's goal and six W's, each with its source — suggestions for the
|
|
32
|
+
* human to confirm in `faf go`, never written to project.faf by init or auto.
|
|
33
|
+
* Same anchors and slop rules as the extractors above. {} if no README. */
|
|
34
|
+
export declare function interrogateReadmeSourced(dir: string): Record<string, ReadmeFind>;
|
|
@@ -53,6 +53,21 @@ export interface ExtractedContext {
|
|
|
53
53
|
example?: string;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
+
/** The README headings that hold each slot's fact — one list, shared by the
|
|
57
|
+
* README interrogator and Relentless. Each is matched as the whole heading
|
|
58
|
+
* (regex source, case-insensitive; groups must be non-capturing). Left out,
|
|
59
|
+
* because they usually hold a misplaced fact: Release / Roadmap (the release
|
|
60
|
+
* process, future plans), History (a changelog), Design (visual design),
|
|
61
|
+
* About (the author), Users (an adopters list). */
|
|
62
|
+
export declare const SECTION_HEADINGS: {
|
|
63
|
+
readonly goal: readonly ["use\\s+cases?", "goals?"];
|
|
64
|
+
readonly what: readonly ["description", "overview", "purpose", "introduction", "what", "what\\s+is\\s+(?!new\\b)\\S+", "what\\s+it\\s+does"];
|
|
65
|
+
readonly who: readonly ["audience", "target\\s+audience", "for\\s+whom", "who", "who\\s+is\\s+(?:this|it)\\s+for", "who\\s+it.s\\s+for"];
|
|
66
|
+
readonly why: readonly ["why", "why\\s+(?:use\\s+)?(?!not\\b)\\S+", "motivations?", "(?:the\\s+)?problem", "rationale", "mission", "vision"];
|
|
67
|
+
readonly where: readonly ["deployment", "where", "where\\s+it\\s+runs", "hosting", "platforms", "supported\\s+platforms", "platform\\s+support"];
|
|
68
|
+
readonly when: readonly ["status", "(?:project|current)\\s+status", "timeline", "since", "launched"];
|
|
69
|
+
readonly how: readonly ["architecture", "how", "how\\s+it\\s+works", "how\\s+does\\s+it\\s+work", "under\\s+the\\s+hood", "internals", "approach", "methodology"];
|
|
70
|
+
};
|
|
56
71
|
/** Confidence threshold rules for extracted text — empty if violated */
|
|
57
72
|
export declare const EXTRACTION_LIMITS: {
|
|
58
73
|
/** Minimum length for a slot to be considered worth filling (in chars) */
|
|
@@ -62,5 +77,24 @@ export declare const EXTRACTION_LIMITS: {
|
|
|
62
77
|
};
|
|
63
78
|
/** Generic slop patterns — extracted text matching these is rejected */
|
|
64
79
|
export declare const SLOP_PATTERNS: readonly RegExp[];
|
|
80
|
+
/** A notice, not a description of the project: maintenance status,
|
|
81
|
+
* sponsors, hiring, where the docs are, requirements, a move or a mirror,
|
|
82
|
+
* merch, a question, a status label or an emoji-led feature label. Fine in
|
|
83
|
+
* `when` (## Status: "No longer maintained since 2024"), never the goal. */
|
|
84
|
+
export declare function isNotice(t: string): boolean;
|
|
85
|
+
/** A callout or banner, not a description: a GitHub admonition, a warning
|
|
86
|
+
* sign, or pre-release phrasing ("Nightly release, expect rough edges"). */
|
|
87
|
+
export declare function isCallout(t: string): boolean;
|
|
88
|
+
/** Lines without a setext title at the top ("Title" over "-----" or
|
|
89
|
+
* "=====") — it is the title, not the first paragraph. */
|
|
90
|
+
export declare function dropSetextTitle(lines: string[]): string[];
|
|
65
91
|
/** Validate extracted text against the no-guess/no-slop doctrine */
|
|
66
92
|
export declare function isValidExtraction(text: string): boolean;
|
|
93
|
+
/** The first sentence of `text` — whole, ending at its own full stop — or
|
|
94
|
+
* null when there is none, or when it is a question (not a fact). For a
|
|
95
|
+
* first paragraph too long to be a slot: its opening sentence is usually the
|
|
96
|
+
* fact ("Flask is a lightweight WSGI web application framework."), and a
|
|
97
|
+
* whole sentence is never a cut. A stop after `e.g.`, `i.e.`, `vs.`, `Dr.`
|
|
98
|
+
* or an ellipsis does not end it; after `etc.` or initials (`U.S.`) it ends
|
|
99
|
+
* only when the next word starts a sentence. */
|
|
100
|
+
export declare function firstSentence(text: string): string | null;
|