Skip to content

Commit

Permalink
Update icons based on Healthicons.org package versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
troccoli committed Jan 28, 2024
1 parent c319a81 commit 0cf6b72
Show file tree
Hide file tree
Showing 1,779 changed files with 10,311 additions and 3,928 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ phpunit.xml
vendor
.phpunit.result.cache
.idea
.original-repo
.heatlhicons
docker-compose.yml
.docker
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ For a full list of available icons see [the SVG directory](resources/svg) or pre
composer require troccoli/blade-health-icons
```

The people at [Healthicons.org](https://healthicons.org/) have now moved to published the icon as an NPM package
following SemVer. This means that I can now tie the releases of this package to that one.

Versions of Blade Health Icon prior to 3.0.0 were based on a date, i.e. from time to time, or when I knew new
icons were available, I would update this package and make a new release.

From now on however, I will follow Healthicons.org versioning, albeit with a slight difference because I had already
started using SemVer.

For this reason, if you want a particular version of the Healthicons.org package then you need to look at
the following table and use the correct version for this package.

| Blade Health Icons | Healthicons.org |
|-------------------|----------------|
| 3.0.0 | 1.0.0 |

## Blade Icons

Blade Healthicons uses Blade Icons under the hood. Please refer to [the Blade Icons readme](https://github.com/blade-ui-kit/blade-icons) for additional functionality. We also recommend to [enable icon caching](https://github.com/blade-ui-kit/blade-icons#caching) with this library.
Expand Down
38 changes: 28 additions & 10 deletions bin/compile.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
#!/usr/bin/env bash

# Run this from the project directory
# e.g. ./bin/compile.sh
# Run this from the project directory making sure to include the
# version of the Healthicons.org NPM package you want
# e.g. ./bin/compile.sh 1.0.0

set -eu
set -eux

if [ -z $1 ]; then
echo "Version is missing."
echo "Usage:"
echo " $0 1.0.0"
exit 1
fi

DIRECTORY=$(cd $(dirname $0) && pwd)
TEMP=$DIRECTORY/../.original-repo
REPO=$TEMP/healthicons
DIST=$REPO/public/icons/svg
VERSION=$1
TEMP=$DIRECTORY/../.healthicons
DIST=$TEMP/node_modules/healthicons/public/icons/svg
RESOURCES=$DIRECTORY/../resources/svg

echo "Removing temporary directory"
echo "Create temporary directory"
if [ -d $TEMP ]; then
rm -rf $TEMP
mkdir $TEMP
fi
mkdir $TEMP

echo "Removing existing icons"
rm $RESOURCES/*

echo "Cloning resolvetosavelives/healthicons repo"
git clone -q https://github.com/resolvetosavelives/healthicons $REPO
echo "Install healthicons package"
cd $TEMP
npm i healthicons@$VERSION

echo "Compiling outline icons..."
for FILE in $DIST/outline/*/*; do
Expand All @@ -41,6 +50,15 @@ for FILE in $DIST/filled/*/*; do
cp $FILE $RESOURCES/f-$(echo $SANITIZEDFILE)
done

echo "Compiling negative icons..."
for FILE in $DIST/negative/*/*; do
# Remove path
SANITIZEDFILE=${FILE##*/}
# Replace _ with -
SANITIZEDFILE=${SANITIZEDFILE//_/-}
cp $FILE $RESOURCES/n-$(echo $SANITIZEDFILE)
done

echo "Cleaning up"
rm -rf $TEMP

Expand Down
26 changes: 12 additions & 14 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Blade Health Icons Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<coverage/>
<testsuites>
<testsuite name="Blade Health Icons Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
4 changes: 2 additions & 2 deletions resources/svg/f-!.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/svg/f-0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/svg/f-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/svg/f-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions resources/svg/f-2g.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/svg/f-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0cf6b72

Please sign in to comment.