Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/dirty-ants-stay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@spectrum-web-components/icons-workflow': minor
---

- Upgraded to `@adobe/spectrum-css-workflow-icons@5.0.0`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice summary, thanks for all these great details!

- Includes changes from previous a4u upstream releases:
- Added `S2_Icon_HeartFilled_20_N.svg`, updated `S2_Icon_SpeedFast_20_N.svg`.
- Replaced all 22×20px Cloud State icons with 20px variants.
- Removed deprecated multi-colored error icon. Added new Cloud State icons (`Disconnected`, `Error`, `InProgress`, `Online`, `Paused`, `Pending`, `SlowConnection`).
- Updated several other icons (`CloseCaptions`, `CommentHide`, `Community`, etc.).
- For the full changelog, see: https://github.com/adobe/spectrum-css-workflow-icons/pull/50
Comment on lines +5 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very well documented summary!

2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ parameters:
# 3. Commit this change to the PR branch where the changes exist.
current_golden_images_hash:
type: string
default: 5cb7586aae24a30d566d452d4e0b3c934fe3b9f0
default: 2a337e2e35a58d526076d6f0428bf70adf3ac70e
wireit_cache_name:
type: string
default: wireit
Expand Down
92 changes: 83 additions & 9 deletions packages/icons-workflow/bin/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/`;

const S1IConsPackageDir = '@adobe/spectrum-css-workflow-icons/dist/18';
const S2IConsPackageDir =
'@adobe/spectrum-css-workflow-icons-s2/dist/assets/svg';
const S1IconsPackagePath = path.dirname(
fileURLToPath(
import.meta.resolve('@adobe/spectrum-css-workflow-icons/package.json')
)
);
const S2IconsPackagePath = path.dirname(
fileURLToPath(
import.meta.resolve(
'@adobe/spectrum-css-workflow-icons-s2/package.json'
)
)
);

const S1IconsDir = path.join(S1IconsPackagePath, 'dist/18');
const S2IconsDir = path.join(S2IconsPackagePath, 'dist/assets/svg');
const keepColors = '';

const ensureDirectoryExists = (dirPath) => {
Expand Down Expand Up @@ -351,13 +363,9 @@ async function buildIcons(icons, tag, iconsNameList) {
});
}

const iconsV1 = (
await fg(`${rootDir}/node_modules/${S1IConsPackageDir}/**.svg`)
).sort();
const iconsV1 = (await fg(`${S1IconsDir}/**.svg`)).sort();

const iconsV2 = (
await fg(`${rootDir}/node_modules/${S2IConsPackageDir}/**.svg`)
).sort();
const iconsV2 = (await fg(`${S2IconsDir}/**.svg`)).sort();

const iconsV1NameList = iconsV1.map((i) => {
return getComponentName(i);
Expand All @@ -381,3 +389,69 @@ fs.appendFileSync(
`${manifestImports}${manifestListings}];\r\n`,
'utf-8'
);

/**
* Generates iconsList.json for filtering icons in Storybook demos and documentation website.
*
* This function processes the available S1 and S2 icon component names and creates a JSON file
* that serves as an allowlist for filtering icons in the iconset Storybook demos. The filtering
* ensures that only icons available in the current Spectrum version are displayed to users.
*
* The function performs the following transformations:
* 1. Converts PascalCase component names (e.g., "HeartFilled") to lowercase (e.g., "heartfilled")
* 2. Filters out any names that start with numbers (invalid icon names)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this one wasn’t filtered by the icons team. As we think about scaling icon processing, it might be helpful to handle this filtering upstream so we don’t need to manage it on our end.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! I see any current icon improvements as the bare minimum to keep the current pipeline running smoothly. Ideally, though, we rethink the whole delivery pipeline to simplify it and reduce the lift on our side 😃

* 3. Sorts the lists alphabetically for consistent output
* 4. Creates separate arrays for S1 and S2 icons
* 5. Writes the prettifiedformatted JSON to packages/iconset/stories/iconsList.json
*
* @example
* Input: ["HeartFilled", "AddCircle", "20Asset"]
* Output: ["addcircle", "heartfilled"] (20Asset filtered out)
*
* @example
* Generated JSON structure:
* {
* "s1": ["abc", "addcircle", "heart", ...],
* "s2": ["accessibility", "addcontent", "heartfilled", ...]
* }
*
* */
const generateIconsList = () => {
// Helper function to transform component names to lowercase format for iconsList.json
const transformIconNames = (nameList) => {
return nameList
.map((name) =>
name.replace(/([A-Z])/g, (match, letter) =>
letter.toLowerCase()
)
)
.filter((name) => !Number.isNaN(Number(name[0])) === false)
.sort();
};

const iconsListData = {
s1: transformIconNames(iconsV1NameList),
s2: transformIconNames(iconsV2NameList),
};

const iconsListPath = path.join(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be a good place to leverage require.resolve with the iconset package name so that when we migrate to the 1st-gen / 2nd-gen set-up, it's able to find it based on package registry instead of path location?

rootDir,
'packages',
'iconset',
'stories',
'iconsList.json'
);

prettier
.format(JSON.stringify(iconsListData), {
parser: 'json',
printWidth: 100,
tabWidth: 4,
useTabs: false,
})
.then((formattedJson) => {
fs.writeFileSync(iconsListPath, formattedJson, 'utf-8');
});
};

generateIconsList();
2 changes: 1 addition & 1 deletion packages/icons-workflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"devDependencies": {
"@adobe/spectrum-css-workflow-icons": "1.7.0",
"@adobe/spectrum-css-workflow-icons-s2": "npm:@adobe/spectrum-css-workflow-icons@4.1.0",
"@adobe/spectrum-css-workflow-icons-s2": "npm:@adobe/spectrum-css-workflow-icons@5.0.0",
"case": "^1.6.1",
"cheerio": "^1.0.0-rc.2",
"fast-glob": "^3.3.3",
Expand Down
Loading
Loading