Skip to content

Commit

Permalink
Release 2.9.0 (#485)
Browse files Browse the repository at this point in the history
* Create eleventy-original.svg

* Create eleventy-plain.svg

* Update devicon.json

* Update eleventy-plain.svg

* Update eleventy-original.svg

* new icon: sqlalchemy (plain, original, original-workmark)

* Add font aliase for sqlalchemy

* new icon: microsoftsqlserver (plain, plain-wordmark) (#427)

* new icon sqlserver (plain, plain-woodmark)

* Update icons/sqlserver/sqlserver-plain-wordmark.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update icons/sqlserver/sqlserver-plain.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update devicon.json

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update devicon.json

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Rename sqlserver icons to microsoftsqlserver

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* new icon: kubernetes (plain, plain-wordmark) (#424)

* new icon: kubernetes (plain, plain-wordmark)

* Update icons/kubernetes/kubernetes-plain.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update icons/kubernetes/kubernetes-plain-wordmark.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* new icon: rocksdb (plain) (#423)

* new icon: rocksdb (plain)

* Update icons/rocksdb/rocksdb-plain.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* new icon: googlecloud (original, original-wordmark, plain, plain-wordmark) (#428)

* new icon: googlecloud (plain, plain-wordmark, original, original-wordmark)

* Update icons/googlecloud/googlecloud-plain.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update icons/googlecloud/googlecloud-original-wordmark.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update icons/googlecloud/googlecloud-original.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Fix google cloud icons

* Fix googlecloud original

* Remove fill redefinition from google cloud original

* Fix googlecloud alignment (Test)

* Fix googlecloud alignment (test)

* Fix googlecloud alignment (test)

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* new icon: objectivec (plain) (#425)

* new icon: objectivec (plain)

* Update icons/objectivec/objectivec-plain.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* new icon uwsgi (original, plain)

* Cleanup uwsgi icons

* Update devicon.json

Co-authored-by: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com>

* Add adobe XD line icon

* Add xd-plain and eps file

* Clean up xd svg file

* Update devicon.json

* new icon: firebase (plain, plain-wordmark) (#461)

* add icon Firebase (plain, plain-wordmark), Closes #204

* new icon: firebase (plain, plain-wordmark)

* update icons

* Add plain-wordmark to firebase fonts

* new icon: flask (original, original-wordmark) (#463)

* Cleanup flask icon

* Improve flask icons

* Update icons/flask/flask-original-wordmark.svg

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

Co-authored-by: moghya <sawantshubham571@gmail.com>
Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update devicon.json

* Fixed an error with devicon.json

* Added check script for the icons and fix icons with fill or viewBox issues (#460)

* Added script to check svg fill and viewBox

* Fix cucumber-plain-wordmark

* Fix various fill and viewBox issues in svgs

* Added check for height and width attr

* Added check_svgs workflow

* Fix an issue where the error is not log properly

* Added on push for testing

* Updated trigger so it now runs whenever PR is update

* Added sleep to script to make logs nicer

* Added script that create env var

* Updated the github_env to accomodate ubuntu

* Change format of log and allow filehandler to return Path

* Updated logging messages

* Updated refs for the checkout action

* Make logging nicer

* Updated fix messaging so it's more clear

* fix icons: icons/cucumber/cucumber-plain-wordmark.svg, icons/intellij/intellij-plain-wordmark.svg, icons/jenkins/jenkins-plain.svg, icons/twitter/twitter-original.svg, icons/yunohost/yunohost-plain.svg

* Fix the ref issue of the checkout action and sqlalchemy  (#472)

* Remove head_ref from checkout action

* Fixed the svg errs in sqlalchemy

* Create a monthly script that checks all svgs

* Python now print traceback

* Updated file names in check_svgs_on_pr

* Remove deprecated and unused svg syntax

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Remove deprecated and unused svg syntax

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update svg fill, remove unused class

* Change comment action to a new action

* Add guideline about squash merging

As the result of discussion #470 update guidelines with squash merging

* Redo the workflow archs so we can comment on pr

* Moved check_svgs_monthly to draft

* Added working workflow file

* Changed to file read action

* new icon: appwrite (plain, original, wordmark) (#371)

* Added Appwrite icon

* Fixed wrong JSON input

* Fixed JSON style

* Fixed indent

* Update devicon.json

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update devicon.json

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* Update devicon.json

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>

* bot:build new icons, icomoon.json and devicon.css (#486)

* fix bash-plain (#451) (#453)

Co-authored-by: Enis Mulić <enis.s.mulic@gmail.com>

* Built new icons, icomoon.json and devicon.css

Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>
Co-authored-by: Enis Mulić <enis.s.mulic@gmail.com>
Co-authored-by: amacado <amacado@users.noreply.github.com>

* Removed 'default fall back icon' from build_icons.yml

Co-authored-by: Tylen St Hilaire <28753109+tylensthilaire@users.noreply.github.com>
Co-authored-by: Enis Mulić <enis.s.mulic@gmail.com>
Co-authored-by: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com>
Co-authored-by: Withee Poositasai <witheep@gmail.com>
Co-authored-by: moghya <sawantshubham571@gmail.com>
Co-authored-by: Thomas Bui <thomasbui198@gmail.com>
Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: amacado <amacado@users.noreply.github.com>
  • Loading branch information
10 people committed Jan 20, 2021
1 parent c5378d6 commit 9c6bfdb
Show file tree
Hide file tree
Showing 65 changed files with 4,396 additions and 457 deletions.
37 changes: 37 additions & 0 deletions .github/drafts/check_devicon_object.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from typing import List

# abandoned since it's not too hard to check devicon objects using our eyes
# however, still keep in case we need it in the future

def check_devicon_objects(icons: List[dict]):
"""
Check that the devicon objects added is up to standard.
"""
err_msgs = []
for icon in icons:
if type(icon["name"]) != str:
err_msgs.append("'name' must be a string, not: " + str(icon["name"]))

try:
for tag in icon["tags"]:
if type(tag) != str:
raise TypeError()
except TypeError:
err_msgs.append("'tags' must be an array of strings, not: " + str(icon["tags"]))
break


if type(icon["versions"]["svg"]) != list or len(icon["versions"]["svg"]) == 0:
err_msgs.append("Icon name must be a string")

if type(icon["versions"]["font"]) != list or len(icon["versions"]["svg"]) == 0:
err_msgs.append("Icon name must be a string")

if type(icon["color"]) != str or "#" not in icon["color"]:
err_msgs.append("'color' must be a string in the format '#abcdef'")

if type(icon["aliases"]) != list:
err_msgs.append("'aliases' must be an array of dicts")

if len(err_msgs) > 0:
raise Exception("Error found in devicon.json: \n" + "\n".join(err_msgs))
26 changes: 26 additions & 0 deletions .github/drafts/check_svgs_monthly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import traceback
import sys

# pycharm complains that build_assets is an unresolved ref
# don't worry about it, the script still runs
from build_assets import filehandler, arg_getters
from build_assets import util


def main():
"""
Check the quality of the svgs of the whole icons folder.
"""
args = arg_getters.get_check_svgs_monthly_args()

try:
devicon_json = filehandler.get_json_file_content(args.devicon_json_path)
svgs = filehandler.get_svgs_paths(devicon_json, args.icons_folder_path)
util.check_svgs(svgs)
print("All SVGs found were good. Task completed.")
except Exception as e:
util.exit_with_err(e)


if __name__ == "__main__":
main()
42 changes: 42 additions & 0 deletions .github/drafts/check_svgs_monthly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check SVGs Monthly
on: workflow_dispatch
# schedule:
# - cron: '0 0 1 * *'
jobs:
check_develop:
name: Check the SVGs' quality in the `develop` branch
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2
with:
ref: develop

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: python -m pip install --upgrade pip

- name: Run the check_svg script
run: >
python ./.github/scripts/check_svgs_monthly.py ./devicon.json ./icons
check_master:
name: Check the SVGs' quality in the `master` branch
runs-on: ubuntu-18.04
steps:

- uses: actions/checkout@v2 # check out default branch, which is master

- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: python -m pip install --upgrade pip

- name: Run the check_svg script
run: >
python ./.github/scripts/check_svgs_monthly.py ./icomoon.json ./devicon.json ./icons
File renamed without changes.
34 changes: 34 additions & 0 deletions .github/scripts/build_assets/arg_getters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@


def get_selenium_runner_args(peek_mode=False):
"""
Get the commandline arguments for the icomoon_peek.py and
icomoon_build.py.
"""
parser = ArgumentParser(description="Upload svgs to Icomoon to create icon files.")

parser.add_argument("--headless",
Expand Down Expand Up @@ -33,4 +37,34 @@ def get_selenium_runner_args(peek_mode=False):
parser.add_argument("--pr_title",
help="The title of the PR that we are peeking at")

return parser.parse_args()


def get_check_svgs_on_pr_args():
"""
Get the commandline arguments for the check_svgs_on_pr.py.
"""
parser = ArgumentParser(description="Check the SVGs to ensure their attributes are correct. Run whenever a PR is opened")
parser.add_argument("files_added_json_path",
help="The path to the files_added.json created by the gh-action-get-changed-files@2.1.4",
action=PathResolverAction)

parser.add_argument("files_modified_json_path",
help="The path to the files_modified.json created by the gh-action-get-changed-files@2.1.4",
action=PathResolverAction)
return parser.parse_args()


def get_check_svgs_monthly_args():
"""
Get the commandline arguments for the check_svgs_monthly.py.
"""
parser = ArgumentParser(description="Check the SVGs to ensure their attributes are correct. Run monthly.")
parser.add_argument("devicon_json_path",
help="The path to the devicon.json",
action=PathResolverAction)

parser.add_argument("icons_folder_path",
help="The path to the icons folder",
action=PathResolverAction)
return parser.parse_args()
122 changes: 97 additions & 25 deletions .github/scripts/build_assets/filehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@
import re


def find_new_icons(devicon_json_path: str, icomoon_json_path: str) -> List[dict]:
def find_new_icons(devicon_json_path: str, icomoon_json_path: str):
"""
Find the newly added icons by finding the difference between
the devicon.json and the icomoon.json.
:param devicon_json_path, the path to the devicon.json.
:param icomoon_json_path: a path to the iconmoon.json.
:return: a list of the new icons as JSON objects.
"""
with open(devicon_json_path) as json_file:
devicon_json = json.load(json_file)

with open(icomoon_json_path) as json_file:
icomoon_json = json.load(json_file)
devicon_json = get_json_file_content(devicon_json_path)
icomoon_json = get_json_file_content(icomoon_json_path)

new_icons = []
for icon in devicon_json:
Expand All @@ -28,7 +25,17 @@ def find_new_icons(devicon_json_path: str, icomoon_json_path: str) -> List[dict]
return new_icons


def is_not_in_icomoon_json(icon, icomoon_json) -> bool:
def get_json_file_content(json_path: str):
"""
Get the json content of the json_path.
:param: json_path, the path to the json file.
:return: a dict representing the file content.
"""
with open(json_path) as json_file:
return json.load(json_file)


def is_not_in_icomoon_json(icon, icomoon_json):
"""
Checks whether the icon's name is not in the icomoon_json.
:param icon: the icon object we are searching for.
Expand All @@ -44,12 +51,16 @@ def is_not_in_icomoon_json(icon, icomoon_json) -> bool:
return True


def get_svgs_paths(new_icons: List[dict], icons_folder_path: str) -> List[str]:
def get_svgs_paths(new_icons: List[dict], icons_folder_path: str,
icon_versions_only: bool=False, as_str: bool=True):
"""
Get all the suitable svgs file path listed in the devicon.json.
:param new_icons, a list containing the info on the new icons.
:param icons_folder_path, the path where the function can find the
listed folders.
:param icon_versions_only, whether to only get the svgs that can be
made into an icon.
:param: as_str, whether to add the path as a string or as a Path.
:return: a list of svg file paths that can be uploaded to Icomoon.
"""
file_paths = []
Expand All @@ -59,27 +70,56 @@ def get_svgs_paths(new_icons: List[dict], icons_folder_path: str) -> List[str]:
if not folder_path.is_dir():
raise ValueError(f"Invalid path. This is not a directory: {folder_path}.")

# TODO: remove the try-except when the devicon.json is upgraded
try:
aliases = icon_info["aliases"]
except KeyError:
aliases = [] # create empty list of aliases if not provided in devicon.json
if icon_versions_only:
get_icon_svgs_paths(folder_path, icon_info, file_paths, as_str)
else:
get_all_svgs_paths(folder_path, icon_info, file_paths, as_str)
return file_paths


def get_icon_svgs_paths(folder_path: Path, icon_info: dict,
file_paths: List[str], as_str: bool):
"""
Get only the svg file paths that can be made into an icon from the icon_info.
:param: folder_path, the folder where we can find the icons.
:param: icon_info, an icon object in the devicon.json.
:param: file_paths, an array containing all the file paths found.
:param: as_str, whether to add the path as a string or as a Path.
"""
aliases = icon_info["aliases"]

for font_version in icon_info["versions"]["font"]:
# if it's an alias, we don't want to make it into an icon
if is_alias(font_version, aliases):
print(f"Skipping this font since it's an alias: {icon_info['name']}-{font_version}.svg")
continue

for font_version in icon_info["versions"]["font"]:
# if it's an alias, we don't want to make it into an icon
if is_alias(font_version, aliases):
print(f"Not exist {icon_info['name']}-{font_version}.svg")
continue
file_name = f"{icon_info['name']}-{font_version}.svg"
path = Path(folder_path, file_name)

file_name = f"{icon_info['name']}-{font_version}.svg"
path = Path(folder_path, file_name)
if path.exists():
file_paths.append(str(path) if as_str else path)
else:
raise ValueError(f"This path doesn't exist: {path}")

if path.exists():
file_paths.append(str(path))
else:
raise ValueError(f"This path doesn't exist: {path}")

return file_paths
def get_all_svgs_paths(folder_path: Path, icon_info: dict,
file_paths: List[str], as_str: bool):
"""
Get all the svg file paths of an icon.
:param: folder_path, the folder where we can find the icons.
:param: icon_info, an icon object in the devicon.json.
:param: file_paths, an array containing all the file paths found.
:param: as_str, whether to add the path as a string or as a Path.
"""
for font_version in icon_info["versions"]["svg"]:
file_name = f"{icon_info['name']}-{font_version}.svg"
path = Path(folder_path, file_name)

if path.exists():
file_paths.append(str(path) if as_str else path)
else:
raise ValueError(f"This path doesn't exist: {path}")


def is_alias(font_version: str, aliases: List[dict]):
Expand Down Expand Up @@ -166,3 +206,35 @@ def create_screenshot_folder(dir, screenshot_name: str="screenshots/"):
print(f"{screenshot_folder} already exist. Script will do nothing.")
finally:
return str(screenshot_folder)

def get_added_modified_svgs(files_added_json_path: str,
files_modified_json_path: str):
"""
Get the svgs added and modified from the files_changed_json_path.
:param: files_added_json_path, the path to the files_added.json created by the gh-action-get-changed-files@2.1.4
:param: files_modified_json_path, the path to the files_modified.json created by the gh-action-get-changed-files@2.1.4
:return: a list of the svg file paths that were added/modified in this pr as Path.
"""
files_added = get_json_file_content(files_added_json_path)
files_modified = get_json_file_content(files_modified_json_path)

svgs = []
for file in files_added:
path = Path(file)
if path.suffix.lower() == ".svg":
svgs.append(path)

for file in files_modified:
path = Path(file)
if path.suffix.lower() == ".svg":
svgs.append(path)

return svgs


def write_to_file(path: str, value: any):
"""
Write the value to a JSON file.
"""
with open(path, "w") as file:
file.write(value)

0 comments on commit 9c6bfdb

Please sign in to comment.