chore: implement generation-specific versioning system #5957
+168
−71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Replaces the
genversionpackage 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 onSpectrumElement.Key Changes:
scripts/generate-versions.jsgenerates version files from package.json with proper copyright headers (imported from HEADER file)VERSION: "1.10.0"andCORE_VERSION: "0.0.1"VERSION: "0.0.1"andCORE_VERSION: "0.0.1"genversionand unused transitive dependenciesVersion files are now generated as TypeScript source (
.ts) and compiled to.jsand.d.tsduring build, matching the pattern used throughout the codebase.Motivation and context
The previous setup used
genversionto generate version files, but had several issues:genversionwas the only tool using several transitive dependenciesThis change enables proper version tracking for debugging, support, and understanding which generation of components is being used.
Related issue(s)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Test 2nd-gen
customElements.get("swc-badge").VERSIONandcustomElements.get("swc-badge").CORE_VERSION0.0.1version is returnedTest 1st-gen
customElements.get("sp-badge").VERSIONandcustomElements.get("sp-badge").CORE_VERSION1.10.0and0.0.1are returned