Skip to content

For Alpha 19#53

Merged
baxyz merged 8 commits intomainfrom
for-alpha-19
Apr 24, 2026
Merged

For Alpha 19#53
baxyz merged 8 commits intomainfrom
for-alpha-19

Conversation

@baxyz
Copy link
Copy Markdown
Contributor

@baxyz baxyz commented Apr 22, 2026

Description

Improves the website metadata build pipeline to correctly handle TypeScript type aliases that are co-located with their companion function.

Problem: Types like Result (in tryit.ts), Falsy (in isFalsy.ts), and Primitive (in isPrimitive.ts) were getting their own standalone documentation pages, even though they are purely internal return/companion types of a single function. This made the docs sidebar noisy and the type pages had no useful standalone context.

Solution:

  • 1:1 companion types (a type that shares its source file with exactly one function) are now embedded as a "Related Types" section inside their companion function's page, and no longer generate a standalone page.
  • 1:N shared types (e.g. SortFn, DateTruncUnit, WeekDay) keep their standalone page since they are referenced by multiple functions.

Additionally, two bugs in serializeType were fixed:

  • namedTupleMember support: named tuple labels (e.g. [error: undefined, value: T]) were previously collapsed to just the member name, losing the type information.
  • predicate support: type guard return types (e.g. value is string) were serialized as just "value" instead of the full predicate.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)

Related Issues

N/A

How Has This Been Tested?

  • Verified Result, Falsy, and Primitive no longer appear as standalone pages after pnpm build + doc generation.
  • Verified Result appears in the "Related Types" section of tryit.md.
  • Verified SortFn, DateTruncUnit, WeekDay still have their own standalone pages (1:N case).
  • Verified isString, isNumber, isValidDate, isArray etc. now show correct type predicate signatures (value is string, value is number, …).
  • Verified Result<T> type definition now correctly serializes as [error: undefined, value: T] | [error: Error, value: undefined].

Checklist

  • My code follows the code style of this project
  • I have updated the documentation accordingly
  • All new and existing tests passed locally
  • My commits follow the conventional commit format

Copilot AI review requested due to automatic review settings April 22, 2026 20:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the website metadata generator to better serialize TypeDoc type information, specifically TypeScript type predicates, so generated signatures/return types are more accurate for the website metadata output.

Changes:

  • Add predicate type handling to serializeType() to render param is SomeType forms.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/build/build-website-metadata.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

✅ PR Validation Passed

All checks passed and coverage target reached!


📋 Pipeline Status

Job Status
🔢 Version passing
🏗️ Build passing
🧪 Tests passing
📝 Lint passing
📘 TypeCheck passing
🔐 Security Audit passing
🧾 Conventional Commits passing
🔗 Coherency passing

📊 Code Coverage

Overall Coverage: 100.0% — Target reached! 🎯

Metric Progress Coverage
Lines ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
Branches ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
Functions ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
Statements ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%

🧬 Mutation Testing

🟢 Mutation Score: 92.62% — excellent

Metric Progress Score
🟢 Mutation Score ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ 92.62%

🧬 Mutation testing is informational only and does not block the PR

📊 View full mutation report on Stryker Dashboard


🌐 Runtime Compatibility

Runtime Compatibility: 3/3 — All runtimes passed!

Runtime Status
🟩 Node.js 24 (LTS) v24.14.1
🦕 Deno 2.7.13
🍞 Bun 1.3.13

🔄 Runtime compatibility is informational only and does not block the PR


⏱️ Benchmarks

Benchmarks: 0 suites — completed

⏱️ Benchmarks are informational only and do not block the PR


ℹ️ About this report
  • 🎯 Coverage Target: 100% for all metrics
  • 🧬 Mutation Testing: powered by Stryker (non-blocking)
  • ⏱️ Benchmarks: powered by Vitest Bench (non-blocking)
  • 🔄 This comment updates automatically with each push
  • 📈 Coverage is measured using Vitest + v8

🤖 Generated by @helpers4 CI • 2026-04-24

baxyz added 3 commits April 22, 2026 22:26
- add relatedTypes to WebsiteFunction interface
- implement logic for companion types in buildWebsiteMetadata
…pers

- implement isArrayBuffer to check ArrayBuffer instances
- implement isBlob to check Blob instances
- implement isBuffer to check Node.js Buffer instances
- implement isFormData to check FormData instances
- add examples and tests for each helper
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helpers/type/isBlob.ts Outdated
Comment thread helpers/type/isFormData.ts Outdated
Comment thread scripts/coherency/jsdoc-since/index.ts
Comment thread scripts/coherency/jsdoc-since/helper.ts Outdated
Comment thread scripts/build/build-website-metadata.ts Outdated
Comment thread scripts/version/release.ts
- ensure Blob and FormData are defined before checking
feat(build): ✨ add optional typeDefinition to WebsiteFunction
fix(jsdoc): 🐛 update index rules for @SInCE tag requirements
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

scripts/coherency/index.ts:19

  • The parallel runner built with commands.join(' & ') + '; wait' can miss failures: backgrounded commands may exit non-zero but the final shell exit code can still be 0 depending on wait’s return status. Since performRelease relies on pnpm run coherency, consider switching to a Node-based runner that captures each child’s exit code (or a shell approach that waits each PID and fails if any failed).
const tests = ['bundle', 'version', 'category', 'dependencies', 'sizes', 'jsdoc-since'];

async function runAllTests() {
  console.log("🔍 Running coherency tests in parallel...\n");

  const commands = tests.map(test => `pnpm exec tsx scripts/coherency/${test}/index.ts`);
  const parallelCommand = commands.join(' & ') + '; wait';


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/coherency/jsdoc-since/index.ts
Comment thread scripts/version/inject-since.ts Outdated
- export SKIP_SUFFIXES and SKIP_FILENAMES
- export isHelperSourceFile function
docs(index): 📝 clarify JSDoc rules for helper files
- specify @SInCE tag requirements in comments
- update console log message for clarity
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/version/release.ts
Comment thread scripts/build/build-website-metadata.ts
@baxyz baxyz enabled auto-merge (rebase) April 24, 2026 16:26
@baxyz baxyz disabled auto-merge April 24, 2026 16:27
@baxyz baxyz merged commit 17f38f2 into main Apr 24, 2026
15 checks passed
@baxyz baxyz deleted the for-alpha-19 branch April 24, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants