-
Notifications
You must be signed in to change notification settings - Fork 222
ci: global changelog generator script #5328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 9 commits
a0f6e3e
a2f863c
9ccb88d
2bf08d8
a849b21
73df35a
24edcd7
ef8f7bb
cab24b0
03ba768
a9d421c
9cf280c
5050e77
bf0afbd
7de437d
eb64182
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,17 +3,152 @@ | |
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
# [1.5.0](https://github.com/adobe/spectrum-web-components/compare/v1.4.0...v1.5.0) (2025-04-15) | ||
# [1.5.0](https://github.com/adobe/spectrum-web-components/compare/v1.4.0...v1.5.0) (2025-04-24) | ||
|
||
### Bug Fixes | ||
## Minor Changes | ||
|
||
**sp-icons-workflow**: Added missing S2 icons | ||
|
||
## Patch Changes | ||
|
||
**sp-popover**: 📝 #[3566](https://github.com/adobe/spectrum-css/pull/3566) Thanks [@aramos-adobe](https://github.com/aramos-adobe)! | ||
|
||
Popover overflow bug on Safari | ||
|
||
- `translateZ` has been added to the open popover to prevent clipping of the `filter: drop-shadow` when overflow is applied. `translateZ` or `translate3d` on the open state accelerates the component to the GPU layer maintaining any transformations and animations. | ||
- `overflow: visible` applied to CSS `*--withTip` so the tip is still visible if overflow is applied to the component. | ||
|
||
**sp-picker**: `PickerBase`(used in `<sp-picker>` and `sp-action-menu>`): | ||
|
||
Fixes focus so that it is not set on `<sp-menu-item>` elements when opened via mouse. | ||
|
||
A keyboard interaction is the only interaction that should set focus on an `<sp-menu-item>` when the menu is opened. A user with a mouse would expect the focus to stay where the mouse is. | ||
|
||
Fixes: #2950 | ||
|
||
**sp-button**: Updated the deprecation warning to allow `variant` and `static-color` exist on the same component. | ||
Added `primary` and `secondary` stories to `white` and `black` button directories on storybook. | ||
Updates documentation site to reflect this as well. | ||
|
||
**sp-infield-button**: # Release Note | ||
|
||
## Infield Button | ||
|
||
### 6.1.2 | ||
|
||
- [#3615](https://github.com/adobe/spectrum-css/pull/3615) [`f09c84a`](https://github.com/adobe/spectrum-css/commit/f09c84ae9922d67b6fe237d693afee0fab53fa67) Thanks [@Rajdeepc](https://github.com/Rajdeepc)! - ### Infield button fast follows | ||
- Updated infield button disabled border color to use `-spectrum-gray-300` for spectrum-two theme and `-spectrum-gray-200` for other themes. | ||
|
||
### 6.1.1 | ||
|
||
📝 [#3536](https://github.com/adobe/spectrum-css/pull/3536) [`f77aa72`](https://github.com/adobe/spectrum-css/commit/f77aa72486f98c7b7d4f449c0d54fb6801881b7e) Thanks [@marissahuysentruyt](https://github.com/marissahuysentruyt)! | ||
|
||
- S2 Foundations fixes | ||
- Adjusts the background-color of the infield button components within stepper to use `gray-100` as opposed to `gray-25`. | ||
- This corresponds to the background-color updates picker has for S2. | ||
- Corrects the border color for the default picker for S2 foundations, using `gray-500` (instead of `gray-800`) to align with other field/form components. | ||
- Refactors the `&.is-keyboardFocused&.is-placeholder` selector to `&.is-keyboardFocused.spectrum-Picker-label.is-placeholder` to avoid unexpectedly targeting the nested placeholder class. | ||
|
||
### 6.1.0 | ||
|
||
📝 [#3541](https://github.com/adobe/spectrum-css/pull/3541) [`1a3245c`](https://github.com/adobe/spectrum-css/commit/1a3245c3a660bc52ed260f18b6cceab5ee81541d) Thanks [@castastrophe](https://github.com/castastrophe)! | ||
|
||
Dependency alignment across the project. | ||
|
||
- Updated dependencies [[`205182b`](https://github.com/adobe/spectrum-css/commit/205182bebcbe82813457aa098d8799b0a23423ee), [`1a3245c`](https://github.com/adobe/spectrum-css/commit/1a3245c3a660bc52ed260f18b6cceab5ee81541d)]: | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
|
||
## Number Field | ||
|
||
Bump @spectrum-css/stepper to 7.1.3 | ||
|
||
### 7.1.3 | ||
|
||
- [#3621](https://github.com/adobe/spectrum-css/pull/3621) [`3aec28a`](https://github.com/adobe/spectrum-css/commit/3aec28aac60bdf32a585fa8ff38559d80b57ff86) Thanks [@marissahuysentruyt](https://github.com/marissahuysentruyt)! | ||
|
||
- Updates `-spectrum-stepper-buttons-border-color-keyboard-focus` from `gray-900` to `gray-800` to match the rest of the border color on keyboardFocus. | ||
|
||
### 7.1.2 | ||
|
||
📝 [#3594](https://github.com/adobe/spectrum-css/pull/3594) [`6200a63`](https://github.com/adobe/spectrum-css/commit/6200a63f2c7dc1d2b0481c33b17c86427726c0bd) Thanks [@TarunAdobe](https://github.com/TarunAdobe)! | ||
|
||
- Updates Stepper's key-focus border color (`-spectrum-stepper-border-color-keyboard-focus`) to `-spectrum-gray-800`. | ||
|
||
### 7.1.1 | ||
|
||
📝 [#3536](https://github.com/adobe/spectrum-css/pull/3536) [`f77aa72`](https://github.com/adobe/spectrum-css/commit/f77aa72486f98c7b7d4f449c0d54fb6801881b7e) Thanks [@marissahuysentruyt](https://github.com/marissahuysentruyt)! | ||
|
||
- S2 Foundations fixes | ||
- Adjusts the background-color of the infield button components within stepper to use `gray-100` as opposed to `gray-25`. | ||
- This corresponds to the background-color updates picker has for S2. | ||
- Corrects the border color for the default picker for S2 foundations, using `gray-500` (instead of `gray-800`) to align with other field/form components. | ||
- Refactors the `&.is-keyboardFocused&.is-placeholder` selector to `&.is-keyboardFocused.spectrum-Picker-label.is-placeholder` to avoid unexpectedly targeting the nested placeholder class. | ||
|
||
### 7.1.0 | ||
|
||
📝 [#3541](https://github.com/adobe/spectrum-css/pull/3541) [`1a3245c`](https://github.com/adobe/spectrum-css/commit/1a3245c3a660bc52ed260f18b6cceab5ee81541d) Thanks [@castastrophe](https://github.com/castastrophe)! | ||
|
||
Dependency alignment across the project. | ||
|
||
- Updated dependencies [[`205182b`](https://github.com/adobe/spectrum-css/commit/205182bebcbe82813457aa098d8799b0a23423ee), [`9b108f7`](https://github.com/adobe/spectrum-css/commit/9b108f7e05df1f55ab315dad96736d3ff4757f8c), [`1a3245c`](https://github.com/adobe/spectrum-css/commit/1a3245c3a660bc52ed260f18b6cceab5ee81541d)]: | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
|
||
## Textfield | ||
|
||
### 8.1.1 | ||
|
||
📝 [#3575](https://github.com/adobe/spectrum-css/pull/3575) [`2e17d10`](https://github.com/adobe/spectrum-css/commit/2e17d109ebec3c2745c32a15840af5c636c8dc5d) Thanks [@TarunAdobe](https://github.com/TarunAdobe)! | ||
|
||
- Updated border color on keyboard focus state for textfield in spectrum-two theme. | ||
|
||
### 8.1.0 | ||
|
||
📝 [#3539](https://github.com/adobe/spectrum-css/pull/3539) [`9b108f7`](https://github.com/adobe/spectrum-css/commit/9b108f7e05df1f55ab315dad96736d3ff4757f8c) Thanks [@rise-erpelding](https://github.com/rise-erpelding)! | ||
|
||
- Updates invalid icon spacing to be vertically centered for S2. | ||
|
||
📝 [#3541](https://github.com/adobe/spectrum-css/pull/3541) [`1a3245c`](https://github.com/adobe/spectrum-css/commit/1a3245c3a660bc52ed260f18b6cceab5ee81541d) Thanks [@castastrophe](https://github.com/castastrophe)! | ||
|
||
- Dependency alignment across the project. | ||
|
||
Set component peerDependencies as optional to reduce console warnings on downstream projects. | ||
|
||
- Updated dependencies [[`205182b`](https://github.com/adobe/spectrum-css/commit/205182bebcbe82813457aa098d8799b0a23423ee), [`1a3245c`](https://github.com/adobe/spectrum-css/commit/1a3245c3a660bc52ed260f18b6cceab5ee81541d)]: | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
|
||
## Search | ||
|
||
### 8.1.2 | ||
|
||
- [#3658](https://github.com/adobe/spectrum-css/pull/3658) [`e9fde67`](https://github.com/adobe/spectrum-css/commit/e9fde67bf341798a6ab34f227b2e7a417d1e5da7) Thanks [@rise-erpelding](https://github.com/rise-erpelding)! - Change S2 theme border color to gray-800 on keyfocus per design request in order to align with text field. | ||
|
||
### 8.1.1 | ||
|
||
📝 [#3593](https://github.com/adobe/spectrum-css/pull/3593) [`d829abb`](https://github.com/adobe/spectrum-css/commit/d829abb44f1eaa1874090e52caee553d776684e7) Thanks [@TarunAdobe](https://github.com/TarunAdobe)! | ||
|
||
Updated `--spectrum-search-background-color-disabled` to `--spectrum-gray-25` and `--spectrum-search-border-color-disabled` to `--spectrum-gray-300` for the S2 foundations contexts. | ||
|
||
Also defines disabled quiet border and background colors (`--system-search-quiet-background-color-disabled` and `--system-search-quiet-border-color-disabled`) in order to maintain disabled quiet styling. | ||
|
||
### 8.1.0 | ||
|
||
📝 [#3541](https://github.com/adobe/spectrum-css/pull/3541) [`1a3245c`](https://github.com/adobe/spectrum-css/commit/1a3245c3a660bc52ed260f18b6cceab5ee81541d) Thanks [@castastrophe](https://github.com/castastrophe)! | ||
|
||
Dependency alignment across the project. | ||
|
||
- Updated dependencies [[`205182b`](https://github.com/adobe/spectrum-css/commit/205182bebcbe82813457aa098d8799b0a23423ee), [`9b108f7`](https://github.com/adobe/spectrum-css/commit/9b108f7e05df1f55ab315dad96736d3ff4757f8c), [`1a3245c`](https://github.com/adobe/spectrum-css/commit/1a3245c3a660bc52ed260f18b6cceab5ee81541d)]: | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
- @spectrum-css/[email protected] | ||
|
||
- **sp-tabs**: ensure tabs become enabled when parent disabled attribute is removed (#5323) ([`c7efe314c5`](https://github.com/adobe/spectrum-web-components/commit/c7efe314c5)) | ||
- **sp-color-field**: color handle positioning within scrollable containers (#5322) ([`e19e55f6f1`](https://github.com/adobe/spectrum-web-components/commit/e19e55f6f1)) | ||
- **sp-menu**: fixes larger margin in menu-item (#5350) ([`86bcd12200`](https://github.com/adobe/spectrum-web-components/commit/86bcd12200)) | ||
- **sp-menu**: menuitem now correctly focus and applies hover styles (#5270) ([`a69accb8b4`](https://github.com/adobe/spectrum-web-components/commit/a69accb8b4)) | ||
- **sp-menu**: captures touchend events on mobile (#5313) ([`4c2f908a92`](https://github.com/adobe/spectrum-web-components/commit/4c2f908a92)) | ||
- **overlay**: prevent overlay close on document scroll (#5308) ([`8f8735c9ec`](https://github.com/adobe/spectrum-web-components/commit/8f8735c9ec)) | ||
- **sp-number-field**: prevent keyboard on mobile devices by setting inpu… (#5284) ([`5a3bc6d24e`](https://github.com/adobe/spectrum-web-components/commit/5a3bc6d24e)) | ||
**sp-close-button**: Remove unnecessary system theme references to reduce complexity for components that don't need the additional mapping layer. | ||
|
||
# [1.4.0](https://github.com/adobe/spectrum-web-components/compare/v1.3.0...v1.4.0) (2025-03-26) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,8 @@ | |
"build:types": "wireit", | ||
"build:watch": "wireit", | ||
"changeset-snapshot-publish": "yarn prepublishOnly && yarn changeset version --snapshot && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag --tag snapshot", | ||
"changeset-publish": "yarn prepublishOnly && yarn changeset version && yarn install && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag && yarn push-to-remote && yarn create-git-tag && yarn postpublish", | ||
"changeset-publish": "yarn prepublishOnly && yarn changeset version && yarn changelog:global && yarn install && yarn lint:versions --fix && yarn update-version && yarn changeset publish --no-git-tag && yarn push-to-remote && yarn create-git-tag && yarn postpublish", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn’t |
||
"changelog:global": "node ./scripts/add-global-changelog.js", | ||
"update-version": "node ./tasks/update-version.js", | ||
"chromatic": "chromatic --build-script-name storybook:build # note that --project-token must be set in your env variables", | ||
"create-git-tag": "node --no-warnings tasks/create-git-tag.js", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
/* | ||
Rajdeepc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Copyright 2025 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
|
||
*/ | ||
|
||
import fs from 'fs'; | ||
import { execSync } from 'child_process'; | ||
import { fileURLToPath } from 'url'; | ||
import path from 'path'; | ||
import { version as newVersion } from '../tools/base/src/version.js'; | ||
|
||
const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
const repoUrl = 'https://github.com/adobe/spectrum-web-components'; | ||
|
||
async function createGlobalChangelog() { | ||
const newTag = `v${newVersion}`; | ||
let prevTag; | ||
try { | ||
const gitTagOutput = execSync('git tag --sort=-creatordate'); | ||
if (!gitTagOutput) { | ||
throw new Error('Git tag command returned empty output'); | ||
} | ||
|
||
const tagList = gitTagOutput.toString().split('\n').filter(Boolean); | ||
if (tagList.length === 0) { | ||
throw new Error('No git tags found in repository'); | ||
} | ||
|
||
prevTag = tagList.find((tag) => tag !== newTag); | ||
if (!prevTag) { | ||
throw new Error( | ||
'Could not find a previous tag different from the new tag' | ||
); | ||
} | ||
} catch (error) { | ||
console.error(`Failed to get previous git tag: ${error.message}`); | ||
process.exit(1); | ||
} | ||
|
||
if (!prevTag) { | ||
console.error('No previous tag found.'); | ||
process.exit(1); | ||
} | ||
|
||
// Read the existing CHANGELOG.md early to check for existing entries | ||
const changelogPath = path.resolve(__dirname, '../CHANGELOG.md'); | ||
let existingChangelog = fs.existsSync(changelogPath) | ||
? fs.readFileSync(changelogPath, 'utf-8') | ||
: ''; | ||
|
||
// Check if this version already has an entry in the changelog | ||
const versionEntryPattern = new RegExp( | ||
`# \\[${newVersion.replace(/\./g, '\\.')}\\]` | ||
); | ||
if (versionEntryPattern.test(existingChangelog)) { | ||
console.log( | ||
`⚠️ Version ${newVersion} already has an entry in the CHANGELOG. Skipping update.` | ||
); | ||
process.exit(0); | ||
} | ||
|
||
const date = new Date().toLocaleDateString('en-CA', { | ||
year: 'numeric', | ||
month: '2-digit', | ||
day: '2-digit', | ||
}); | ||
// We need to use a stable release tag (not a pre-release/beta) for the comparison URL | ||
// to ensure the changelog shows changes between proper semver releases | ||
const compareUrl = `${repoUrl}/compare/${prevTag}...${newTag}`; | ||
// Read all changesets from the .changeset directory | ||
const changesetDir = path.resolve(__dirname, '../.changeset'); | ||
const changesetFiles = fs | ||
.readdirSync(changesetDir) | ||
.filter((file) => file.endsWith('.md') && file !== 'README.md'); | ||
|
||
const majorChanges = []; | ||
const minorChanges = []; | ||
const patchChanges = []; | ||
|
||
// Process each changeset file | ||
for (const file of changesetFiles) { | ||
const filePath = path.join(changesetDir, file); | ||
const content = fs.readFileSync(filePath, 'utf-8'); | ||
|
||
// Extract the frontmatter from the changeset | ||
const frontmatterMatch = content.match( | ||
/---\n([\s\S]*?)\n---\n([\s\S]*)/ | ||
); | ||
|
||
if (frontmatterMatch) { | ||
const [, frontmatter, description] = frontmatterMatch; | ||
|
||
// Parse the frontmatter to determine the change type | ||
console.log(frontmatter); | ||
const isMajor = frontmatter.includes('major'); | ||
const isMinor = frontmatter.includes('minor'); | ||
// If not major or minor, it's a patch | ||
|
||
// Extract the package scope from the frontmatter | ||
const packageMatch = frontmatter.match( | ||
/'@spectrum-web-components\/([^']+)':|"@spectrum-web-components\/([^"]+)":/ | ||
); | ||
// Extract component name from package name and prefix with "sp-" | ||
const scope = packageMatch ? `sp-${packageMatch[1]}` : 'core'; | ||
// Clean up the description text | ||
const cleanDescription = description.trim(); | ||
|
||
// Create the entry (without commit hash since we're using changesets) | ||
const entry = `**${scope}**: ${cleanDescription}\n\n`; | ||
|
||
// Categorize based on semver bump type | ||
if (isMajor) { | ||
majorChanges.push(entry); | ||
} else if (isMinor) { | ||
minorChanges.push(entry); | ||
} else { | ||
patchChanges.push(entry); | ||
} | ||
} | ||
} | ||
|
||
// Skip if nothing relevant | ||
if (!majorChanges.length && !minorChanges.length && !patchChanges.length) { | ||
console.log('🚫 No changes to add to the changelog.'); | ||
process.exit(0); | ||
} | ||
|
||
// Format new changelog entry | ||
let newEntry = `# [${newVersion}](${compareUrl}) (${date})\n\n`; | ||
|
||
if (majorChanges.length) { | ||
newEntry += `## Major Changes\n\n${majorChanges.join('\n')}\n\n`; | ||
} | ||
|
||
if (minorChanges.length) { | ||
newEntry += `## Minor Changes\n\n${minorChanges.join('\n')}\n\n`; | ||
} | ||
|
||
if (patchChanges.length) { | ||
newEntry += `## Patch Changes\n\n${patchChanges.join('\n')}\n\n`; | ||
} | ||
|
||
// Preserve the header if it exists | ||
let headerText = ''; | ||
const headerMatch = existingChangelog.match( | ||
/^(# Change Log\n\n[\s\S]+?(?=\n\n# \[))/ | ||
); | ||
if (headerMatch) { | ||
headerText = headerMatch[1]; | ||
existingChangelog = existingChangelog.substring(headerMatch[0].length); | ||
} else if (existingChangelog.startsWith('# Change Log')) { | ||
// Handle case where there might not be any versions yet | ||
const simpleHeaderMatch = existingChangelog.match( | ||
/^(# Change Log\n\n[\s\S]+?)(?=\n\n|$)/ | ||
); | ||
if (simpleHeaderMatch) { | ||
headerText = simpleHeaderMatch[1]; | ||
existingChangelog = existingChangelog.substring(headerText.length); | ||
} | ||
} | ||
|
||
fs.writeFileSync( | ||
changelogPath, | ||
`${headerText}\n\n${newEntry.trim()}\n\n${existingChangelog.trim()}`, | ||
'utf-8' | ||
); | ||
console.log(`✅ CHANGELOG updated for ${newVersion}`); | ||
} | ||
|
||
createGlobalChangelog().catch((error) => { | ||
console.error('Error updating changelog:', error); | ||
process.exit(1); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this in here because the branch needs to be rebased with main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was testing the new script.