Skip to content

Conversation

@rubencarvalho
Copy link
Contributor

@rubencarvalho rubencarvalho commented Jan 9, 2026

Description

Replaces the genversion package with a custom version generation script that properly handles versioning for both 1st-gen and 2nd-gen packages. Each generation now correctly reports its own version via static properties on SpectrumElement.

Key Changes:

  • New script: scripts/generate-versions.js generates version files from package.json with proper copyright headers (imported from HEADER file)
  • 1st-gen versioning: Components report VERSION: "1.10.0" and CORE_VERSION: "0.0.1"
  • 2nd-gen versioning: Components report VERSION: "0.0.1" and CORE_VERSION: "0.0.1"
  • Dependency cleanup: Removed genversion and unused transitive dependencies
  • Build updates: Updated wireit, lint-staged, publish scripts, and CI workflows

Version files are now generated as TypeScript source (.ts) and compiled to .js and .d.ts during build, matching the pattern used throughout the codebase.

Motivation and context

The previous setup used genversion to generate version files, but had several issues:

  1. Cross-generation confusion: 1st-gen version file was being generated from 1st-gen's package.json, causing both generations to report the same version
  2. No copyright headers: Generated files lacked proper Adobe copyright headers
  3. Inflexibility: Couldn't track both generation-specific versions AND core version
  4. Unnecessary dependency: genversion was the only tool using several transitive dependencies

This change enables proper version tracking for debugging, support, and understanding which generation of components is being used.

Related issue(s)

  • fixes SWC-TBD

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Test 2nd-gen

    1. Go here
    2. Open the developer tool console
    3. Write customElements.get("swc-badge").VERSION and customElements.get("swc-badge").CORE_VERSION
    4. Verify the correct 0.0.1 version is returned
  • Test 1st-gen

    1. Go here
    2. Open the developer tool console
    3. Write customElements.get("sp-badge").VERSION and customElements.get("sp-badge").CORE_VERSION
    4. Verify the correct versions 1.10.0 and 0.0.1 are returned

@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2026

⚠️ No Changeset found

Latest commit: 8a88f14

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5957

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@rubencarvalho rubencarvalho changed the title chore: wip [WIP] chore: refactor SpectrumElement versioning Jan 12, 2026
@rubencarvalho rubencarvalho changed the title [WIP] chore: refactor SpectrumElement versioning chore: refactor SpectrumElement versioning Jan 19, 2026
@rubencarvalho rubencarvalho changed the title chore: refactor SpectrumElement versioning chore: implement generation-specific versioning system Jan 19, 2026
@rubencarvalho rubencarvalho added Status: Ready for review PR ready for review or re-review. 2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. labels Jan 19, 2026
@rubencarvalho rubencarvalho marked this pull request as ready for review January 19, 2026 14:41
@rubencarvalho rubencarvalho requested a review from a team as a code owner January 19, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. Status: Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants