Skip to content

Commit 8e22a3d

Browse files
authored
chore: sync with main
chore: sync with main
2 parents f946a3e + e4debc5 commit 8e22a3d

16 files changed

+51
-53
lines changed

.github/CODEOWNERS

-17
This file was deleted.

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Please see our [Contributor Code of Conduct](./CODE_OF_CONDUCT.md) for informati
5050

5151
1. Run `npm start` from the root directory to start a local version of the icon test.
5252
2. Modify the icon test as needed in the `index.html` file.
53-
53+
3. If you are modifying icons, you can run `npm run build.files` to re-run the SVG optimization script to verify there are no changes after optimizing the SVG.
5454

5555
<!-- #### Building Changes
5656

.github/workflows/actions/test-e2e/action.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ runs:
5555
npx playwright test --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots
5656
git add src/\*.png --force
5757
mkdir updated-screenshots
58-
echo 'made dir'
5958
rsync -R --progress $(git diff --name-only --cached) updated-screenshots
60-
echo 'copied images'
61-
if [ -d updated-screenshots ]; then
59+
if [ "$(ls -A updated-screenshots)" ]; then
6260
echo "hasUpdatedScreenshots=$(echo 'true')" >> $GITHUB_OUTPUT
6361
cd updated-screenshots
6462
ls

.github/workflows/release.yml

+19-10
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,22 @@ jobs:
5555
env:
5656
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5757
shell: bash
58-
# Lerna does not automatically bump versions
59-
# of Ionicons dependencies that have changed,
60-
# so we do that here.
61-
- name: Bump Package Lock
62-
run: |
63-
npx lerna exec "npm install --package-lock-only --legacy-peer-deps"
64-
git add .
65-
git commit -m "chore(): update package lock files"
66-
git push
67-
shell: bash
58+
59+
update-package-lock:
60+
# This needs to run after finalize-release
61+
# because we also push to the repo in that
62+
# job. If these jobs ran in parallel then it is
63+
# possible for them to push at the same time.
64+
needs: [finalize-release]
65+
runs-on: ubuntu-latest
66+
steps:
67+
# Lerna does not automatically bump versions
68+
# of Ionicons dependencies that have changed,
69+
# so we do that here.
70+
- name: Bump Package Lock
71+
run: |
72+
npx lerna exec "npm install --package-lock-only --legacy-peer-deps"
73+
git add .
74+
git commit -m "chore(): update package lock files"
75+
git push
76+
shell: bash

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [7.2.2](https://github.com/ionic-team/ionicons/compare/v7.2.1...v7.2.2) (2023-12-13)
7+
8+
9+
### Bug Fixes
10+
11+
* **icon:** add better warning when loading icons ([#1297](https://github.com/ionic-team/ionicons/issues/1297)) ([d582e62](https://github.com/ionic-team/ionicons/commit/d582e6208e626722e4350426a509a6870e90a0bc))
12+
13+
14+
15+
16+
617
## [7.2.1](https://github.com/ionic-team/ionicons/compare/v7.2.0...v7.2.1) (2023-10-10)
718

819

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"packages": [
33
"./"
44
],
5-
"version": "7.2.1"
5+
"version": "7.2.2"
66
}

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ionicons",
3-
"version": "7.2.1",
3+
"version": "7.2.2",
44
"description": "Premium icons for Ionic.",
55
"files": [
66
"components/",

playwright.config.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,7 @@ const config: PlaywrightTestConfig = {
5252
* Maximum time expect() should wait for the condition to be met.
5353
* For example in `await expect(locator).toHaveText();`
5454
*/
55-
timeout: 5000,
56-
toMatchSnapshot: {
57-
/**
58-
* Increases the maximum allowed pixel difference to account
59-
* for slight browser rendering inconsistencies.
60-
*/
61-
maxDiffPixelRatio: 0.02
62-
}
55+
timeout: 5000
6356
},
6457
/* Fail the build on CI if you accidentally left test.only in the source code. */
6558
forbidOnly: !!process.env.CI,

scripts/build.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ async function optimizeSvgs(srcSvgData: SvgData[]) {
5353
if (!Array.isArray(params.attrs)) {
5454
params.attrs = [params.attrs];
5555
}
56+
57+
/**
58+
* All host SVG elements must have
59+
* the ionicons class otherwise styles
60+
* will not apply.
61+
*/
62+
if (item.elem === 'svg') {
63+
item.class.add('ionicon');
64+
}
65+
5666
if (item.isElem()) {
5767
item.eachAttr((attr) => {
5868
if (attr.name === 'fill') {
@@ -167,14 +177,8 @@ async function optimizeSvg(
167177
const srcSvgContent = await fs.readFile(svgData.srcFilePath, 'utf8');
168178

169179
const optimizedSvg = await optimizePass.optimize(srcSvgContent, { path: svgData.srcFilePath });
170-
171-
const optimizedCode = optimizedSvg.data.replace(
172-
/<svg (.*?)>/,
173-
`<svg xmlns="http://www.w3.org/2000/svg" class="ionicon" viewBox="0 0 512 512">`,
174-
);
175-
176-
const webComponentSvg = await webComponentPass.optimize(optimizedCode, { path: svgData.srcFilePath });
177-
const sourceSvg = await sourcePass.optimize(optimizedCode, { path: svgData.srcFilePath });
180+
const webComponentSvg = await webComponentPass.optimize(optimizedSvg.data, { path: svgData.srcFilePath });
181+
const sourceSvg = await sourcePass.optimize(optimizedSvg.data, { path: svgData.srcFilePath });
178182

179183
svgData.optimizedSvgContent = webComponentSvg.data;
180184

src/components/icon/test/icon.e2e.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test.describe('icon: basic', () => {
88
// Wait for all SVGs to be lazily loaded before taking screenshots
99
await page.waitForLoadState('networkidle');
1010

11-
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot(`icon-diff.png`);
11+
await expect(page).toHaveScreenshot(`icon-diff.png`, { fullPage: true });
1212
});
1313

1414
test('some icons should flip when rtl', async ({ page }) => {
Loading
Loading

src/components/test/dynamic-type/icon.e2e.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test.describe('icon: dynamic type', () => {
1313

1414
const icons = page.locator('#icons');
1515

16-
expect(await icons.screenshot()).toMatchSnapshot(`icon-dynamic-type-diff.png`);
16+
await expect(icons).toHaveScreenshot(`icon-dynamic-type-diff.png`);
1717
});
1818

1919
});

0 commit comments

Comments
 (0)