Skip to content

RC #229 - #230

Merged
rmenner merged 2 commits into
mainfrom
rc/229
Nov 13, 2025
Merged

RC #229#230
rmenner merged 2 commits into
mainfrom
rc/229

Conversation

@rmenner

@rmenner rmenner commented Nov 13, 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

Introduce separate API and documentation build commands, a development server, and refine documentation generation and CI workflows

New Features:

  • Add api, docs, and serve functions to generate API markdown, compile documentation, and launch a development server
  • Extend the CLI docs command with --api, --cem, and --serve flags and integrate server options

Enhancements:

  • Update docs-generator getElements to prioritize WCA modules when available
  • Modify the analyze script to invoke the new api function instead of docs

CI:

  • Upgrade npm to the latest version in GitHub workflows
  • Publish npm packages with the latest tag in the PR release workflow

@rmenner
rmenner requested a review from a team as a code owner November 13, 2025 22:08
@sourcery-ai

sourcery-ai Bot commented Nov 13, 2025

Copy link
Copy Markdown

Reviewer's Guide

This PR refactors the documentation build pipeline by separating API generation and Markdown compilation, adds a development server command, updates the CLI interface, enhances filter logic in the docs generator, bumps npm in CI workflows, and adapts the analyze script to use the new API task.

Sequence diagram for new docs CLI command flow

sequenceDiagram
    participant User as actor User
    participant CLI as "docsCommand"
    participant Docs as "Docs"
    participant API as "api()"
    participant Serve as "serve()"

    User->>CLI: Run docs command with options
    CLI->>Docs: cem() (if --cem)
    CLI->>API: api() (if --api)
    CLI->>Docs: docs()
    CLI->>Serve: serve(options) (if --serve)
Loading

Class diagram for updated Docs generator and documentation tasks

classDiagram
    class Docs {
        +static manifest
        +static getElements() CustomElementDeclaration[]
        +static isWcaModule(module)
        +static generate()
    }
    Docs : +static getElements() CustomElementDeclaration[]
    Docs : getElements() now uses wcaModules filter logic
    Docs : generate() used by api task

    class APITask {
        +async api()
    }
    class DocsTask {
        +async docs()
    }
    class ServeTask {
        +async serve(options)
    }

    Docs <.. APITask : uses
    Docs <.. DocsTask : uses
    ServeTask <.. DocsTask : can be triggered after docs
Loading

Flow diagram for documentation build pipeline after refactor

flowchart TD
    A["cem() - Generate Custom Elements Manifest"]
    B["api() - Generate API md file"]
    C["docs() - Compile documentation"]
    D["serve() - Start development server"]

    A --> B --> C --> D
    A -.-> C
    B -.-> D
    C -.-> D
    %% Dashed arrows indicate optional/conditional steps based on CLI options
Loading

File-Level Changes

Change Details Files
Refactor docs index to separate API and Markdown build tasks and add serve command
  • Import runDefaultDocsBuild and startDevelopmentServer utilities
  • Rename docs() to api() with updated spinner messages and error handling
  • Introduce new docs() to run defaultDocsBuild and adjust spinner text
  • Add serve() to launch development server
src/scripts/docs/index.ts
Update CLI command to expose API, CEM, and serve options
  • Import api, docs, serve, and withServerOptions
  • Add --api flag alongside --cem
  • Wrap command with server options support
  • Wire up api(), docs(), and serve() in action
src/commands/docs.ts
Enhance docs-generator filtering to conditionally apply WCA module logic
  • Collect wcaModules list before reduction
  • Apply Docs.isWcaModule only when wcaModules exist
src/scripts/docs/docs-generator.ts
Add npm upgrade step and publish tag in CI workflows
  • Insert 'Upgrade npm' step before build in both workflows
  • Append --tag=latest to npm publish command in pr-release.yml
.github/workflows/pr-release.yml
.github/workflows/test-and-release.yml
Adapt analyze script to call new API task
  • Replace await docs() with await api() in analyzeComponents
src/scripts/analyze.js

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

@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 api and docs flags on the single docs command can be confusing—consider splitting them into distinct commands or more descriptive flags for clarity.
  • Rather than reassigning docsCommand via a let, chain your .command().option().action() calls directly to simplify the CLI setup.
  • In Docs.getElements, you filter wcaModules then check them again in the reducer—merging those conditions into a single pass would improve readability.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `api` and `docs` flags on the single `docs` command can be confusing—consider splitting them into distinct commands or more descriptive flags for clarity.
- Rather than reassigning `docsCommand` via a `let`, chain your `.command().option().action()` calls directly to simplify the CLI setup.
- In `Docs.getElements`, you filter `wcaModules` then check them again in the reducer—merging those conditions into a single pass would improve readability.

## Individual Comments

### Comment 1
<location> `src/scripts/docs/index.ts:50-52` </location>
<code_context>
   }
 }
+
+export async function serve(options = {}) {
+  await startDevelopmentServer(options);
+}
</code_context>

<issue_to_address>
**suggestion:** The serve function does not handle errors from startDevelopmentServer.

Add error handling to serve to log errors and provide spinner feedback, ensuring consistency with other exported functions.

```suggestion
import ora from "ora";

export async function serve(options = {}) {
  const serveSpinner = ora("Starting development server...").start();
  try {
    await startDevelopmentServer(options);
    serveSpinner.succeed("Development server started successfully!");
  } catch (error) {
    const errorMessage = error instanceof Error ? error.message : String(error);
    serveSpinner.fail("Failed to start development server: " + errorMessage);
    console.error(error);
    throw error;
  }
}
```
</issue_to_address>

### Comment 2
<location> `.github/workflows/pr-release.yml:38` </location>
<code_context>
         run: npm run auro-internal -- pr-release -p ${{ github.event.pull_request.number }}
       - name: Publish to NPM
-        run: npm publish --registry=https://registry.npmjs.org
+        run: npm publish --registry=https://registry.npmjs.org --tag=latest
         env:
           NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
</code_context>

<issue_to_address>
**question (bug_risk):** Adding --tag=latest to npm publish may overwrite the latest tag unexpectedly.

Using --tag=latest for PR releases may unintentionally mark unstable builds as the latest stable version. Use a distinct tag for PR or pre-release builds to avoid confusion.
</issue_to_address>

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 38e4228 into main Nov 13, 2025
19 of 20 checks passed
@rmenner
rmenner deleted the rc/229 branch November 13, 2025 22:16
@jason-capsule42

Copy link
Copy Markdown
Member

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jason-capsule42 jason-capsule42 added the released Completed work has been released label Nov 13, 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.

3 participants