diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 27f7dc6..488aaaa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -85,3 +85,18 @@ jobs: - name: Test run: pnpm --filter "${{ matrix.package }}" --if-present run test + + # Sentinel job — aggregates all matrix results into a single status check. + # Add "CI" as the required check in branch protection rules. + ci: + name: CI + needs: check + if: always() + runs-on: ubuntu-latest + steps: + - name: All checks passed + run: | + if [[ "${{ needs.check.result }}" != "success" ]]; then + echo "One or more package checks failed: ${{ needs.check.result }}" + exit 1 + fi diff --git a/docs/modules/extractor/extract.ts b/docs/modules/extractor/extract.ts index 8dce030..2145a68 100644 --- a/docs/modules/extractor/extract.ts +++ b/docs/modules/extractor/extract.ts @@ -154,11 +154,26 @@ function getDescription(jsdocs: JSDoc[], tags: JSDocTag[]): string { return ''; } +/** + * Example text straight from the tag SOURCE. `getCommentText()` runs through + * the TS JSDoc parser, which strips each line's leading whitespace — code + * indentation is gone. Instead take the raw tag text and remove only the + * comment scaffolding (`@example` head, per-line ` * ` prefixes). + */ +function rawExampleText(tag: JSDocTag): string { + return tag.getText() + .replace(/^@example[ \t]?/, '') + .split('\n') + .map(line => line.replace(/^\s*\*(?: |\/\s*$)?/, '')) + .join('\n') + .replace(/\*\/?$/, '').trimEnd(); +} + function getExamples(tags: JSDocTag[]): string[] { return tags .filter(t => t.getTagName() === 'example') .map((t) => { - let text = t.getCommentText()?.trim() ?? ''; + let text = rawExampleText(t).trim(); // A leading `…` (JSDoc example title) isn't valid code — // turn it into a leading comment so the snippet stays clean & highlightable. let caption = ''; diff --git a/vue/primitives/src/aspect-ratio/AspectRatio.vue b/vue/primitives/src/aspect-ratio/AspectRatio.vue index f3227ba..b0cfe3b 100644 --- a/vue/primitives/src/aspect-ratio/AspectRatio.vue +++ b/vue/primitives/src/aspect-ratio/AspectRatio.vue @@ -17,6 +17,7 @@ export interface AspectRatioProps extends PrimitiveProps {