Skip to content

Conversation

@rmenner
Copy link

@rmenner rmenner commented Nov 13, 2025

Alaska Airlines Pull Request

Breaking repo upgrade
Resolves: AlaskaAirlines/auro-cli#191

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

Upgrade repository to use the Auro CLI toolchain and standardized project templates, modernize component implementations to LitElement v4 with SCSS styling, update package configuration, documentation, demos, tests, and CI workflows to align with Auro Design System conventions.

Enhancements:

  • Add static register methods and central index.js export for custom element registration
  • Migrate component styles from CSS JS to SCSS and use updated @aurodesignsystem/auro-library runtime utilities
  • Modernize LitElement usage to v4 patterns including array-based styles and named exports
  • Revamp tests formatting and imports for consistency and readability

Build:

  • Switch build and development scripts to use auro build and auro dev commands
  • Update package.json with exports, files, and publishConfig for ESM support and provenance

CI:

  • Replace custom GitHub workflows with centralized reusable Auro actions for PR validation, tests, releases, and demos
  • Simplify CodeQL workflow to reference external template

Documentation:

  • Regenerate README from Auro templates with partials and auto-generated sections
  • Update API documentation tables to reflect new properties, attributes, and methods

Tests:

  • Refactor test files to use consistent import ordering and formatting
  • Adjust accessibility test suites for updated component markup and rules

Chores:

  • Bump dependencies to align with Auro CLI v3 and drop outdated packages
  • Add GitHub configuration files including CODEOWNERS, settings.yml, issue templates, and stale bot configuration
  • Set project version to 0.0.0 in preparation for initial release

- Added @aurodesignsystem/auro-config.
- Added new configs pointing to auro-config.
- Replaced esLint and scssLint scripts with a unified lint command using biome and stylelint.

AlaskaAirlines/auro-cli#107
BREAKING CHANGE:
Package exports have changed. To access the component class add /class to the end of the import. See "exports" in the package.json for more details.

AlaskaAirlines/auro-cli#108
AlaskaAirlines/auro-cli#109
AlaskaAirlines/auro-cli#110
AlaskaAirlines/auro-cli#111
Workflows added/updated:
- add-project
- check-commits
- check-pr
- codeql
- dev-demo
- pull-request
- release
- sync-tags

AlaskaAirlines/auro-cli#106
@rmenner rmenner requested a review from a team as a code owner November 13, 2025 23:15
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 13, 2025

Reviewer's Guide

This PR performs a breaking upgrade of the repo by migrating styling to SCSS, integrating the auro-cli build system, adding runtime component registration, restructuring package exports, regenerating documentation from templates, normalizing tests and workflows, and tweaking utility code.

Class diagram for updated custom elements with runtime registration

classDiagram
  class AuroTokenList {
    +Array componentData
    +String type
    +String swatchType
    +Boolean version
    +String unit
    +getTableHeaders()
    +size(arg, value)
    +isGradient(value)
    +formatGradientValue(gradientObj)
    +formatSingleGradient(gradient)
    +hexToRgb(hex)
    +deprecatedType(value)
    +currentToken(reference)
    +static register(name)
    +render()
    <<customElement>>
  }
  class AuroTokenDisplay {
    +String appearance
    +Array componentData
    +Boolean ondark
    +firstUpdated()
    +fetchWCAG(colorValue, backgroundColor)
    +validateRatings(wcag)
    +static register(name)
    +render()
    <<customElement>>
  }
  class AuroTokenAvatar {
    +String appearance
    +String avatartype
    +String colorname
    +static register(name)
    +render()
    <<customElement>>
  }
  class RuntimeUtils {
    +registerComponent(name, classRef)
  }
  AuroTokenList ..> RuntimeUtils : uses
  AuroTokenDisplay ..> RuntimeUtils : uses
  AuroTokenAvatar ..> RuntimeUtils : uses
Loading

Class diagram for new index.js module exports

classDiagram
  class index {
    +AuroTokenList
    +AuroTokenDisplay
    +AuroTokenAvatar
  }
  index --> AuroTokenList
  index --> AuroTokenDisplay
  index --> AuroTokenAvatar
Loading

File-Level Changes

Change Details Files
Migrate component styling from CSS modules to SCSS and update style imports
  • Import .scss styles instead of JS CSS modules
  • Switch static styles to return an array of styleCss
  • Update SCSS loader usage in build
src/auro-tokenlist.js
src/auro-tokendisplay.js
src/auro-tokenavatar.js
Introduce static register methods and remove manual customElements.define
  • Import RuntimeUtils and implement static register(name) in each component
  • Export classes instead of defining elements inline
  • Add src/index.js to re-export components
src/auro-tokenlist.js
src/auro-tokendisplay.js
src/auro-tokenavatar.js
src/index.js
Overhaul package.json and build scripts to adopt auro-cli and formal exports
  • Update version to 0.0.0, main to dist/registered.js and add types field
  • Replace rollup and custom scripts with auro build/dev/test commands
  • Define exports map and files array for npm packaging
  • Adjust dependencies and devDependencies to auro-cli ecosystem
package.json
Regenerate documentation and demo using AURO-GENERATED-CONTENT templates
  • Replace README.md sections with autogenerated placeholders
  • Add/modify docs/partials and API example files
  • Update demo/index.html and demo/api.html to load templates
  • Refresh PULL_REQUEST_TEMPLATE.md
README.md
docs/partials/description.md
docs/partials/readmeAddlInfo.md
demo/index.html
demo/api.html
.github/PULL_REQUEST_TEMPLATE.md
Standardize and refactor test files formatting
  • Reorder and quote imports consistently
  • Convert querySelector calls to multi-line for clarity
  • Normalize expect assertions and async helper usage
test/auro-tokenlist.test.js
test/auro-tokenavatar.test.js
Adopt centralized CI workflows via auro-actions
  • Simplify codeql.yml to reference auro-actions workflow
  • Add new .github/workflows that use umbrella auro-actions definitions
  • Update repository settings to align with CI defaults
.github/workflows/codeql.yml
.github/workflows/pull-request.yml
.github/workflows/release.yml
.github/workflows/check-pr.yml
.github/workflows/dev-demo.yml
.github/workflows/add-project.yml
.github/workflows/check-commits.yml
.github/workflows/sync-tags.yml
Tweak utility functions for consistent parsing and formatting
  • Standardize varName switch cases with double quotes
  • Format cacheFetch responseParser fallback with indentation
  • Minor regex and parsing adjustments
src/util.js
src/cacheFetch.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

@rmenner rmenner linked an issue Nov 13, 2025 that may be closed by this pull request
Copy link

@sourcery-ai sourcery-ai bot left a comment

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:

  • package.json has been reset to version "0.0.0"—please confirm and update to the intended release version before publishing.
  • The migration to SCSS imports (e.g. style-tokenlist.scss) relies on the new Auro CLI build pipeline—please verify that these assets are correctly compiled and bundled in CI.
  • Peer dependencies have been consolidated after the CLI upgrade—double-check that all required runtime dependencies (e.g. auro-icon, auro-popover) are still declared or bundled for downstream consumers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- package.json has been reset to version "0.0.0"—please confirm and update to the intended release version before publishing.
- The migration to SCSS imports (e.g. style-tokenlist.scss) relies on the new Auro CLI build pipeline—please verify that these assets are correctly compiled and bundled in CI.
- Peer dependencies have been consolidated after the CLI upgrade—double-check that all required runtime dependencies (e.g. auro-icon, auro-popover) are still declared or bundled for downstream consumers.

## Individual Comments

### Comment 1
<location> `test/auro-tokendisplay.test.js:154-157` </location>
<code_context>
   });

-  it('auro-tokendisplay WCAG ratio from webaim.org is displayed', async () => {
+  it("auro-tokendisplay WCAG ratio from webaim.org is displayed", async () => {
     const el = await fixture(html`
       <auro-tokendisplay componentData=${componentData}></auro-tokendisplay>
</code_context>

<issue_to_address>
**suggestion (testing):** Consider adding a test for error handling when webaim.org is unreachable.

Please add a test that verifies the UI response when the WCAG API is unreachable, such as displaying 'n/a' or an error message.

Suggested implementation:

```javascript

  it("displays 'n/a' when WCAG API is unreachable", async () => {
    // Mock the fetch or API call used by auro-tokendisplay to get WCAG ratio
    // This assumes the component uses window.fetch or similar internally
    const originalFetch = window.fetch;
    window.fetch = () => Promise.reject(new Error("Network error"));

    const el = await fixture(html`
      <auro-tokendisplay componentData=${componentData}></auro-tokendisplay>
    `);

    // Wait for any async updates (if the component uses async/await or updates after fetch)
    await el.updateComplete?.();

    // Check that the UI displays 'n/a' or an error message
    // Adjust the selector and expected text as needed for your implementation
    const wcagRatioCell = el.shadowRoot
      ? el.shadowRoot.querySelector(".wcag-ratio")
      : el.querySelector(".wcag-ratio");
    await expect(wcagRatioCell?.textContent).to.match(/n\/a|error/i);

    // Restore original fetch
    window.fetch = originalFetch;
  });

  it("auro-tokendisplay custom element is defined", async () => {
    const el = Boolean(customElements.get("auro-tokendisplay"));
    await expect(el).to.be.true;
  });


```

- If your component uses a different method to fetch the WCAG ratio (e.g., XMLHttpRequest, a custom fetch function, or a library), you will need to mock that instead of window.fetch.
- Adjust the selector `.wcag-ratio` and the expected text to match your actual DOM structure and error display.
- If your component does not use `updateComplete`, use an appropriate method to wait for the UI to update after the failed fetch.
</issue_to_address>

### Comment 2
<location> `test/auro-tokenlist.test.js:380-377` </location>
<code_context>
   });

-  it('auro-tokenlist deprecated version table is accessible', async () => {
+  it("auro-tokenlist deprecated version table is accessible", async () => {
     const el = await fixture(html`
       <auro-tokenlist type="deprecated" version componentData='[
</code_context>

<issue_to_address>
**suggestion (testing):** Consider adding tests for empty or malformed componentData.

Please add tests for cases where componentData is empty, missing fields, or malformed to verify the component remains stable and accessible.
</issue_to_address>

### Comment 3
<location> `docs/api.md:11` </location>
<code_context>
| colorname  | colorname  |           | string                                                    |           | Pass in `-`(dash) to delimitated name of color token.                                       |
</code_context>

<issue_to_address>
**issue (typo):** Typo: 'delimitated' should be 'delimited'.

The correct wording is: 'Pass in a dash (`-`) to delimit the name of the color token.'

```suggestion
| colorname  | colorname  |           | string                                                    |           | Pass in a dash (`-`) to delimit the name of the color token.                                |
```
</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.

@github-actions
Copy link

🚀 PR Release Published! v0.0.0-pr33.0

To install:

npm install @aurodesignsystem-dev/[email protected]

Install via alias:

npm install @aurodesignsystem/auro-tokenlist@npm:@aurodesignsystem-dev/[email protected]

View on npmjs.com

@github-actions
Copy link

Component Demo Links

tokenlist: https://auro-tokenlist-33.surge.sh

@github-actions
Copy link

🚨 Breaking Change Review Policy

This PR contains breaking changes and requires at least 2 approving reviews to be merged.

Approvals: 0 of 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update auro-tokenlist

2 participants