Skip to content

Commit 533c41d

Browse files
committed
feat(icon,ui-icons)!: migrate the icon compiler to a distinct package
BREAKING CHANGE: - icon will no longer contain SVG assets
1 parent a987407 commit 533c41d

File tree

169 files changed

+389
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+389
-430
lines changed

.github/actions/file-diff/index.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,12 @@ async function run() {
113113
if (hasDiff) {
114114
// If a diff path was provided and the component folder doesn't exist,
115115
// report that the compiled assets were removed
116-
if (!existsSync(join(diffPath, "components", name))) {
116+
if (
117+
!existsSync(join(diffPath, "components", name)) ||
118+
(totalSize === 0 && totalDiffSize > 0)
119+
) {
117120
data.push("🚨 package deleted/moved/renamed");
118-
summaryTable.push(data);
119-
return;
120-
}
121-
122-
if (totalSize > 0 && totalDiffSize === 0) {
123-
data.push("⚠️ assets deleted/moved/renamed");
124-
summaryTable.push(data);
125-
return;
126-
}
127-
128-
if (totalSize === 0 && totalDiffSize > 0) {
121+
} else if (totalSize > 0 && totalDiffSize === 0) {
129122
data.push("🎉 new package");
130123
} else {
131124
data.push(printChange(totalDiffSize - totalSize));

.github/workflows/compare-results.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ jobs:
7373
shell: bash
7474
run: yarn install --frozen-lockfile --cache-folder .cache/yarn
7575

76-
- name: Download build artifacts for head ${{ inputs.head-sha }}
76+
- name: Download build artifacts for head
7777
uses: actions/download-artifact@v3
7878
with:
7979
name: ubuntu-latest-node18-compiled-assets-${{ inputs.head-sha }}
80-
path: ${{ github.workspace }}/${{ inputs.head-sha }}/components
80+
path: ${{ github.workspace }}/${{ inputs.head-sha }}
8181

82-
- name: Download build artifacts for base ${{ inputs.base-sha }}
82+
- name: Download build artifacts for base
8383
uses: actions/download-artifact@v3
8484
with:
8585
name: ubuntu-latest-node18-compiled-assets-${{ inputs.base-sha }}
86-
path: ${{ github.workspace }}/${{ inputs.base-sha }}/components
86+
path: ${{ github.workspace }}/${{ inputs.base-sha }}
8787

8888
- name: Compare compiled output file size
8989
id: compare
@@ -92,7 +92,10 @@ jobs:
9292
with:
9393
path: ${{ github.workspace }}/${{ inputs.head-sha }}/
9494
diff-path: ${{ github.workspace }}/${{ inputs.base-sha }}/
95-
file-glob-pattern: components/*/dist/**
95+
file-glob-pattern: |
96+
components/*/dist/**
97+
tokens/dist/**
98+
ui-icons/dist/**
9699
token: ${{ secrets.GITHUB_TOKEN }}
97100

98101
fetch-build-artifacts:
@@ -161,16 +164,13 @@ jobs:
161164
uses: actions/cache@v3
162165
with:
163166
path: |
164-
components/*/dist/**
167+
components/*/dist/**
168+
tokens/dist/**
169+
ui-icons/dist/**
165170
key: ${{ steps.derive-key.outputs.key }}
166171

167-
- name: Build components
168-
if: ${{ matrix.branch == inputs.base-sha && steps.cache-build.outputs.cache-hit != 'true' }}
169-
shell: bash
170-
run: yarn build
171-
172-
- name: Build components
173-
if: ${{ matrix.branch == inputs.head-sha && steps.cache-build.outputs.cache-hit != 'true' }}
172+
- name: Build
173+
if: ${{ steps.cache-build.outputs.cache-hit != 'true' }}
174174
shell: bash
175175
run: yarn build
176176

@@ -179,7 +179,9 @@ jobs:
179179
uses: actions/upload-artifact@v3
180180
with:
181181
path: |
182-
${{ github.workspace }}/components/*/dist/**
182+
${{ github.workspace }}/components/*/dist/**
183+
${{ github.workspace }}/tokens/dist/**
184+
${{ github.workspace }}/ui-icons/dist/**
183185
name: ${{ steps.derive-key.outputs.key }}
184186
# this is important, it lets us catch if the build failed silently
185187
# by alterting us that no compiled assets were generated

.storybook/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const componentPkgs = readdirSync(componentsPath, {
88
.map((dirent) => dirent.name);
99
module.exports = {
1010
stories: [
11-
"../components/*/stories/*.stories.mdx",
1211
"../components/*/stories/*.stories.@(js|jsx|ts|tsx)",
1312
],
1413
rootDir: "../",

.storybook/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"dependencies": {
1010
"@adobe/spectrum-css-workflow-icons": "^1.5.4",
1111
"@spectrum-css/expressvars": "^3.0.9",
12-
"@spectrum-css/icon": "^4.0.5",
1312
"@spectrum-css/site": "^4.0.2",
1413
"@spectrum-css/tokens": "^13.0.5",
14+
"@spectrum-css/ui-icons": "^0.0.0",
1515
"@spectrum-css/vars": "^9.0.8"
1616
},
1717
"devDependencies": {

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ For most use cases, you'll want to use `spectrum-css-icons.svg` so you have supp
149149
```js
150150
<script src="node_modules/loadicons/index.js"></script>
151151
<script>
152-
loadIcons('node_modules/@spectrum-css/icon/dist/spectrum-css-icons.svg');
152+
loadIcons('node_modules/@spectrum-css/ui-icons/dist/spectrum-css-icons.svg');
153153
</script>
154154
```
155155

156156
Based on which scales you'll be using, you can choose to load different files:
157157

158-
- `@spectrum-css/icon/dist/spectrum-css-icons.svg` - Both medium and large icons for responsive UIs that support both `.spectrum--medium` and `.spectrum--large`
158+
- `@spectrum-css/ui-icons/dist/spectrum-css-icons.svg` - Both medium and large icons for responsive UIs that support both `.spectrum--medium` and `.spectrum--large`
159159
- `@spectrum-css/icon/dist/spectrum-css-icons-medium.svg` - Medium icons only, supports `.spectrum--medium` only
160160
- `@spectrum-css/icon/dist/spectrum-css-icons-large.svg` - Large icons only, supports `.spectrum--large` only
161161

components/icon/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# `@spectrum-css/icon`
22

3-
The icons component contains all UI icons used for components as well as the CSS for UI and workflow icons.
3+
The icons component contains the CSS for UI and workflow icons.

components/icon/combined/Arrow100.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Arrow200.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Arrow300.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Arrow400.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Arrow500.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Arrow600.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Arrow75.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Asterisk100.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Asterisk200.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Asterisk300.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Asterisk75.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Checkmark100.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Checkmark200.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Checkmark300.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Checkmark400.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Checkmark50.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Checkmark500.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Checkmark600.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Checkmark75.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Chevron100.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Chevron200.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Chevron300.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

components/icon/combined/Chevron400.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)