Skip to content

RC #239#242

Merged
rmenner merged 2 commits into
mainfrom
rc/239
Dec 3, 2025
Merged

RC #239#242
rmenner merged 2 commits into
mainfrom
rc/239

Conversation

@rmenner

@rmenner rmenner commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

Alaska Airlines Pull Request

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Update documentation generation formatting and simplify build pipeline by delegating TypeScript definition output to the custom elements manifest tooling.

Enhancements:

  • Sanitize and consistently format default values and type annotations in generated docs, including normalizing union separators and wrapping literal values in code formatting.
  • Remove the bespoke Rollup-based d.ts build flow from watch and production builds in favor of generating JSX/TS types via the custom elements manifest configuration.
  • Add JSX types generation configuration to the custom-elements-manifest setup and wire in the corresponding dependency.

Build:

  • Eliminate the Rollup d.ts build configuration and related watch/production build tasks now superseded by JSX types generation tooling.

Documentation:

  • Improve readability and consistency of generated API docs by cleaning quote usage and code formatting for default values and type signatures.

@rmenner
rmenner requested a review from a team as a code owner December 3, 2025 00:21
@sourcery-ai

sourcery-ai Bot commented Dec 3, 2025

Copy link
Copy Markdown

Reviewer's Guide

Refines generated docs formatting for default values and types, and replaces the custom Rollup-based d.ts build pipeline with @wc-toolkit/jsx-types-driven type generation integrated into the custom-elements manifest config, simplifying build/watch flows by removing d.ts tasks and config.

Class diagram for updated Docs docs-generator behavior

classDiagram
  class Docs {
    +generatePropertyTable(mergedData: MergedTableData[]): string
    +getTypeText(obj: any): string
    -normalizeType(text: string): string
  }

  class MergedTableData {
    +properties: string
    +attributes: string
    +modifiers: string
    +type: string
    +default: string
    +description: string
  }

  Docs ..> MergedTableData : reads
Loading

File-Level Changes

Change Details Files
Normalize how default property values are rendered in generated markdown tables.
  • Transform raw default value strings by trimming, stripping surrounding single or double quotes, and wrapping non-empty defaults in backticks so they render as code in markdown.
  • Preserve already backticked default values to avoid double-wrapping.
  • Continue to escape all table cell content via the existing markdown escaping helper.
src/scripts/docs/docs-generator.ts
Unify and enrich type-string normalization in docs generation to also format quoted type literals consistently.
  • Introduce a normalizeType utility that both standardizes spacing around union separators ("
") and converts single-quoted type segments to backticked code spans for markdown.
  • Use normalizeType for all supported type representations (simple string, type.text, type.name, union and fallback stringification) instead of repeating regex logic.
  • Simplify fallback handling by delegating to normalizeType rather than manually normalizing union separators.
  • Remove the bespoke Rollup-based d.ts build path in favor of JSX types generation via the custom-elements manifest pipeline.
    • Delete getDtsConfig from the build configuration utilities and stop invoking it during production builds and watch mode.
    • Remove the dts task, state tracking, and initial-build dependency from watchModeHandlers, so only analyze and docs tasks remain.
    • Drop rollup-plugin-dts from dependencies and introduce @wc-toolkit/jsx-types as a new dependency, wiring its jsxTypesPlugin into custom-elements-manifest.config.mjs with output settings for dist/index.d.ts and options like defaultExport and excludeCssCustomProperties.
    • Stop calling buildTypeDefinitions in the main build flow so type definitions are now produced by @wc-toolkit/jsx-types instead of Rollup.
    src/scripts/build/watchModeHandlers.js
    src/scripts/build/configUtils.js
    src/scripts/build/index.js
    src/configs/custom-elements-manifest.config.mjs
    package.json
    package-lock.json

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    @rmenner rmenner linked an issue Dec 3, 2025 that may be closed by this pull request

    @sourcery-ai sourcery-ai Bot left a comment

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

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

    Hey there - I've reviewed your changes - here's some feedback:

    • The inline default value sanitization/wrapping logic in docs-generator.ts is getting a bit dense; consider extracting it into a small helper function (e.g., formatDefaultValue) both for readability and to make its behavior easier to unit-test and reuse.
    • The new normalizeType utility replaces all single-quoted segments with backticks; if there are any cases where single quotes are semantically important (e.g., textual comments in types), you may want to narrow this regex or limit it to known type patterns to avoid unintended formatting.
    • Since normalizeType is a pure helper used across several branches, consider moving it out of the method body so it isn’t re-created on each call and to make its intent more discoverable.
    Prompt for AI Agents
    Please address the comments from this code review:
    
    ## Overall Comments
    - The inline default value sanitization/wrapping logic in `docs-generator.ts` is getting a bit dense; consider extracting it into a small helper function (e.g., `formatDefaultValue`) both for readability and to make its behavior easier to unit-test and reuse.
    - The new `normalizeType` utility replaces all single-quoted segments with backticks; if there are any cases where single quotes are semantically important (e.g., textual comments in types), you may want to narrow this regex or limit it to known type patterns to avoid unintended formatting.
    - Since `normalizeType` is a pure helper used across several branches, consider moving it out of the method body so it isn’t re-created on each call and to make its intent more discoverable.

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    @rmenner
    rmenner merged commit 7535409 into main Dec 3, 2025
    21 of 24 checks passed
    @rmenner
    rmenner deleted the rc/239 branch December 3, 2025 00:27
    @jason-capsule42

    Copy link
    Copy Markdown
    Member

    🎉 This PR is included in version 3.4.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

    @jason-capsule42 jason-capsule42 added the released Completed work has been released label Dec 3, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    released Completed work has been released semantic-status: feat

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    RC 2025-12-02

    3 participants