@orkestrel/guide 0.0.28 → 0.0.29
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.
|
@@ -589,27 +589,6 @@ export declare function createDriftContract(): ContractInterface<Drift>;
|
|
|
589
589
|
source: OptionalShape<StringShape>;
|
|
590
590
|
}, false>;
|
|
591
591
|
|
|
592
|
-
/**
|
|
593
|
-
* Escapes every regex metacharacter in a literal string so it reads as text
|
|
594
|
-
* inside a larger `RegExp` source rather than as syntax.
|
|
595
|
-
*
|
|
596
|
-
* @remarks
|
|
597
|
-
* A caller-supplied name reaches a `RegExp` through this: {@link
|
|
598
|
-
* findUnexampled} splices it into a word-boundary search, so a name carrying
|
|
599
|
-
* `$`, `(`, `[`, or `.` matches that character literally instead of throwing or
|
|
600
|
-
* matching text it does not name. Pure and total; never throws.
|
|
601
|
-
*
|
|
602
|
-
* @param value - The literal string to escape
|
|
603
|
-
* @returns `value` with every regex metacharacter backslash-escaped
|
|
604
|
-
*
|
|
605
|
-
* @example
|
|
606
|
-
* ```ts
|
|
607
|
-
* escapeRegExp('A.B') // 'A\\.B'
|
|
608
|
-
* new RegExp(`^${escapeRegExp('A.B')}$`).test('AxB') // false
|
|
609
|
-
* ```
|
|
610
|
-
*/
|
|
611
|
-
export declare function escapeRegExp(value: string): string;
|
|
612
|
-
|
|
613
592
|
/**
|
|
614
593
|
* Lists the declaration keywords a documented or exported symbol carries, in the order the
|
|
615
594
|
* reflection grammar names them — the frozen population `ExportKeyword`, `isExportKeyword`, and
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -589,27 +589,6 @@ export declare function createDriftContract(): ContractInterface<Drift>;
|
|
|
589
589
|
source: OptionalShape<StringShape>;
|
|
590
590
|
}, false>;
|
|
591
591
|
|
|
592
|
-
/**
|
|
593
|
-
* Escapes every regex metacharacter in a literal string so it reads as text
|
|
594
|
-
* inside a larger `RegExp` source rather than as syntax.
|
|
595
|
-
*
|
|
596
|
-
* @remarks
|
|
597
|
-
* A caller-supplied name reaches a `RegExp` through this: {@link
|
|
598
|
-
* findUnexampled} splices it into a word-boundary search, so a name carrying
|
|
599
|
-
* `$`, `(`, `[`, or `.` matches that character literally instead of throwing or
|
|
600
|
-
* matching text it does not name. Pure and total; never throws.
|
|
601
|
-
*
|
|
602
|
-
* @param value - The literal string to escape
|
|
603
|
-
* @returns `value` with every regex metacharacter backslash-escaped
|
|
604
|
-
*
|
|
605
|
-
* @example
|
|
606
|
-
* ```ts
|
|
607
|
-
* escapeRegExp('A.B') // 'A\\.B'
|
|
608
|
-
* new RegExp(`^${escapeRegExp('A.B')}$`).test('AxB') // false
|
|
609
|
-
* ```
|
|
610
|
-
*/
|
|
611
|
-
export declare function escapeRegExp(value: string): string;
|
|
612
|
-
|
|
613
592
|
/**
|
|
614
593
|
* Lists the declaration keywords a documented or exported symbol carries, in the order the
|
|
615
594
|
* reflection grammar names them — the frozen population `ExportKeyword`, `isExportKeyword`, and
|
package/dist/src/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { INTRINSICS, arrayOf, arrayShape, createContract, holds, isBoundedJSONRecord, isEmptyString, isNonEmptyArray, isNonEmptyString, isString, literalOf, literalShape, objectShape, optionalShape, recordOf, stringShape, unionOf, unionShape } from "@orkestrel/contract";
|
|
2
|
-
import { coalesceText, createMarkdown, flattenText, isBlockquoteNode, isCodeBlockNode, isCodeSpanNode, isEmphasisNode, isHeadingNode, isImageNode, isLinkNode, isParagraphNode, isTableNode, renderMarkdown,
|
|
1
|
+
import { INTRINSICS, arrayOf, arrayShape, createContract, escapeRegExp, holds, isBoundedJSONRecord, isEmptyString, isNonEmptyArray, isNonEmptyString, isString, literalOf, literalShape, objectShape, optionalShape, recordOf, stringShape, unionOf, unionShape } from "@orkestrel/contract";
|
|
2
|
+
import { coalesceText, createMarkdown, flattenText, isBlockquoteNode, isCodeBlockNode, isCodeSpanNode, isEmphasisNode, isHeadingNode, isImageNode, isLinkNode, isParagraphNode, isTableNode, renderMarkdown, walkMarkdownNodes } from "@orkestrel/markdown";
|
|
3
3
|
// src/core/constants.ts
|
|
4
4
|
/**
|
|
5
5
|
* Lists the declaration keywords a documented or exported symbol carries, in the order the
|
|
@@ -1097,7 +1097,7 @@ function findFirstCode(nodes) {
|
|
|
1097
1097
|
*/
|
|
1098
1098
|
function extractCellLinks(cell) {
|
|
1099
1099
|
const links = [];
|
|
1100
|
-
for (const node of
|
|
1100
|
+
for (const node of walkMarkdownNodes({
|
|
1101
1101
|
element: "paragraph",
|
|
1102
1102
|
children: cell
|
|
1103
1103
|
})) if (isLinkNode(node)) links.push(node.href);
|
|
@@ -1641,28 +1641,6 @@ function joinHead(lines, start) {
|
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
1643
|
/**
|
|
1644
|
-
* Escapes every regex metacharacter in a literal string so it reads as text
|
|
1645
|
-
* inside a larger `RegExp` source rather than as syntax.
|
|
1646
|
-
*
|
|
1647
|
-
* @remarks
|
|
1648
|
-
* A caller-supplied name reaches a `RegExp` through this: {@link
|
|
1649
|
-
* findUnexampled} splices it into a word-boundary search, so a name carrying
|
|
1650
|
-
* `$`, `(`, `[`, or `.` matches that character literally instead of throwing or
|
|
1651
|
-
* matching text it does not name. Pure and total; never throws.
|
|
1652
|
-
*
|
|
1653
|
-
* @param value - The literal string to escape
|
|
1654
|
-
* @returns `value` with every regex metacharacter backslash-escaped
|
|
1655
|
-
*
|
|
1656
|
-
* @example
|
|
1657
|
-
* ```ts
|
|
1658
|
-
* escapeRegExp('A.B') // 'A\\.B'
|
|
1659
|
-
* new RegExp(`^${escapeRegExp('A.B')}$`).test('AxB') // false
|
|
1660
|
-
* ```
|
|
1661
|
-
*/
|
|
1662
|
-
function escapeRegExp(value) {
|
|
1663
|
-
return value.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
|
|
1664
|
-
}
|
|
1665
|
-
/**
|
|
1666
1644
|
* Collects every `export class` / `export interface` declaration one file's source text declares,
|
|
1667
1645
|
* each keyed `${keyword} ${name}` and carrying the body lines and the base identifiers read from
|
|
1668
1646
|
* its own head, so a body and a heritage clause always come from the same declaration.
|
|
@@ -2177,7 +2155,7 @@ function extractUnnamed(document) {
|
|
|
2177
2155
|
*/
|
|
2178
2156
|
function extractLinks(document) {
|
|
2179
2157
|
const links = [];
|
|
2180
|
-
for (const node of
|
|
2158
|
+
for (const node of walkMarkdownNodes(document)) if (isLinkNode(node)) links.push(node.href);
|
|
2181
2159
|
return links;
|
|
2182
2160
|
}
|
|
2183
2161
|
/**
|
|
@@ -2194,7 +2172,7 @@ function extractLinks(document) {
|
|
|
2194
2172
|
*/
|
|
2195
2173
|
function extractTests(document) {
|
|
2196
2174
|
const links = [];
|
|
2197
|
-
for (const block of selectSectionBlocks(document, TESTS)) for (const node of
|
|
2175
|
+
for (const block of selectSectionBlocks(document, TESTS)) for (const node of walkMarkdownNodes(block)) if (isLinkNode(node)) links.push(node.href);
|
|
2198
2176
|
return links;
|
|
2199
2177
|
}
|
|
2200
2178
|
/**
|
|
@@ -2730,7 +2708,7 @@ function extractFences(document) {
|
|
|
2730
2708
|
*/
|
|
2731
2709
|
function collectFences(document) {
|
|
2732
2710
|
const fences = [];
|
|
2733
|
-
Iterator.from(
|
|
2711
|
+
Iterator.from(walkMarkdownNodes(document)).reduce((title, node) => {
|
|
2734
2712
|
if (isHeadingNode(node)) return flattenText(node).trim();
|
|
2735
2713
|
if (isCodeBlockNode(node)) fences.push([node, {
|
|
2736
2714
|
language: node.lang,
|
|
@@ -4664,6 +4642,6 @@ function createMethodGroupContract() {
|
|
|
4664
4642
|
function createManifestEntryContract() {
|
|
4665
4643
|
return createContract(manifestEntryShape);
|
|
4666
4644
|
}
|
|
4667
|
-
export { DRIFT_CATEGORIES, EXPORT_KEYWORDS, EXTERNAL_SCHEMES, GUIDE_CODES, GUIDE_ERROR_BRAND, Guide, GuideError, KIND, MANIFEST, METHODS, NAME, Parity, SIGNATURE, SUMMARY, SURFACE, SURFACE_HEADER, Source, SourceManager, TESTS, WRAP_WIDTH, buildCell, buildComment, buildFence, buildTable, collectDeclarations, collectExamples, collectFences, collectGroups, collectKeys, collectSummaries, collectTitles, compareMembership, computeDepths, computeDrift, computeModuleKey, computeSymbolKey, createDriftContract, createGuide, createManifestEntryContract, createMethodEntryContract, createMethodGroupContract, createSource, createSourceExampleContract, createSourceManager, createSurfaceSymbolContract, driftShape,
|
|
4645
|
+
export { DRIFT_CATEGORIES, EXPORT_KEYWORDS, EXTERNAL_SCHEMES, GUIDE_CODES, GUIDE_ERROR_BRAND, Guide, GuideError, KIND, MANIFEST, METHODS, NAME, Parity, SIGNATURE, SUMMARY, SURFACE, SURFACE_HEADER, Source, SourceManager, TESTS, WRAP_WIDTH, buildCell, buildComment, buildFence, buildTable, collectDeclarations, collectExamples, collectFences, collectGroups, collectKeys, collectSummaries, collectTitles, compareMembership, computeDepths, computeDrift, computeModuleKey, computeSymbolKey, createDriftContract, createGuide, createManifestEntryContract, createMethodEntryContract, createMethodGroupContract, createSource, createSourceExampleContract, createSourceManager, createSurfaceSymbolContract, driftShape, extractBodyLines, extractCellLinks, extractCellText, extractDeclaration, extractExampleLines, extractExampleMethods, extractExamples, extractExports, extractFenceImports, extractFences, extractHidden, extractLinks, extractMemberMethods, extractMethods, extractRowEntry, extractRowSummary, extractRowSymbol, extractSignature, extractSignatures, extractSourceComments, extractSourceLines, extractSurface, extractTagline, extractTests, extractUnnamed, findClosing, findColumnIndex, findDrift, findFirstCode, findMissing, findMissingSymbols, findSeparators, findUnexampled, findUnlisted, formatDrift, formatSide, hasBehaviouralSurface, hasCanonicalSegments, identifyDrift, isDrift, isDriftCategory, isExportKeyword, isExternalLink, isGuideError, isManifestEntry, isMethodEntry, isMethodGroup, isSourceExample, isSurfaceSymbol, joinHead, locateComment, manifestEntryShape, maskFences, methodEntryShape, methodGroupShape, normalizeComment, normalizeDirectories, normalizeIdentifier, normalizeSummary, parseManifest, renderExample, renderMember, renderMethods, renderSurface, replaceCell, replaceExample, replaceFence, replaceSummary, resolveLink, resolvePath, selectModuleKeys, selectSectionBlocks, sourceExampleShape, spliceSpan, surfaceSymbolShape, unwrapComment, validateModules, validateSurface, wrapText };
|
|
4668
4646
|
|
|
4669
4647
|
//# sourceMappingURL=index.js.map
|