diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..20db8b63
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,17 @@
+* text=auto
+
+# SVGs are treated as binary by default
+*.svg text
+
+# Don't diff machine generated files
+package-lock.json -diff
+
+# Treat images as binary
+*.ico binary
+*.png binary
+
+# Don't export/archive these files
+.github export-ignore
+.gitpod.yml export-ignore
+.travis.yml export-ignore
+CNAME export-ignore
diff --git a/.travis.yml b/.travis.yml
index 6f9d1a82..c5cf27cf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,20 @@ jobs:
- npm run test
- stage: deploy
- name: "NPM Package"
+ name: "Git tag"
+ language: minimal
+ if: branch = master
+
+ before_deploy:
+ - git config --local user.name "$GITHUB_USERNAME"
+ - git config --local user.email "$GITHUB_EMAIL"
+ - export PACKAGE_VERSION=$(cat package.json | grep 'version' | sed 's/[ \",:]//g' | sed 's/version//')
+ - git tag $PACKAGE_VERSION
+ deploy:
+ provider: releases
+ api_key: "$GITHUB_TOKEN"
+ skip_cleanup: true
+ - name: "NPM Package"
language: node_js
node_js: 8
if: branch = master
diff --git a/_data/simple-icons.json b/_data/simple-icons.json
index 574f736a..b9318b41 100644
--- a/_data/simple-icons.json
+++ b/_data/simple-icons.json
@@ -665,6 +665,11 @@
"hex": "A81D33",
"source": "https://www.debian.org/logos"
},
+ {
+ "title": "deepin",
+ "hex": "007CFF",
+ "source": "https://commons.wikimedia.org/wiki/File:Deepin_logo.svg"
+ },
{
"title": "Deezer",
"hex": "00C7F2",
@@ -1500,6 +1505,11 @@
"hex": "C21325",
"source": "https://jestjs.io/"
},
+ {
+ "title": "JET",
+ "hex": "FBBA00",
+ "source": "https://de.wikipedia.org/wiki/Datei:JET.svg"
+ },
{
"title": "Jira",
"hex": "172B4D",
@@ -2390,6 +2400,11 @@
"hex": "8CA1AF",
"source": "https://github.com/rtfd/readthedocs.org/blob/master/media/readthedocsbranding.ai"
},
+ {
+ "title": "Realm",
+ "hex": "39477F",
+ "source": "https://realm.io/press"
+ },
{
"title": "Reason",
"hex": "DD4B39",
@@ -2645,6 +2660,11 @@
"hex": "000000",
"source": "https://blog.society6.com/app/themes/society6/dist/images/mark.svg"
},
+ {
+ "title": "Socket.io",
+ "hex": "010101",
+ "source": "https://socket.io"
+ },
{
"title": "Sogou",
"hex": "FB6022",
diff --git a/icons/deepin.svg b/icons/deepin.svg
new file mode 100644
index 00000000..eea4cf9a
--- /dev/null
+++ b/icons/deepin.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/icons/jet.svg b/icons/jet.svg
new file mode 100644
index 00000000..3c5c6970
--- /dev/null
+++ b/icons/jet.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/icons/realm.svg b/icons/realm.svg
new file mode 100644
index 00000000..d23862e0
--- /dev/null
+++ b/icons/realm.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/icons/socket-dot-io.svg b/icons/socket-dot-io.svg
new file mode 100644
index 00000000..29a09b52
--- /dev/null
+++ b/icons/socket-dot-io.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 66681866..b82d9719 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "simple-icons",
- "version": "1.13.0",
+ "version": "1.14.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index 0c289ccf..4be8f846 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "simple-icons",
- "version": "1.13.0",
+ "version": "1.14.0",
"description": "SVG icons for popular brands https://simpleicons.org",
"homepage": "https://www.simpleicons.org",
"keywords": [
diff --git a/scripts/build-package.js b/scripts/build-package.js
index 287b2f2e..74b5d78d 100644
--- a/scripts/build-package.js
+++ b/scripts/build-package.js
@@ -11,10 +11,17 @@ const fs = require("fs");
const util = require("util");
const minify = require("uglify-js").minify;
+const UTF8 = "utf8";
+
const dataFile = "../_data/simple-icons.json";
const indexFile = `${__dirname}/../index.js`;
const iconsDir = `${__dirname}/../icons`;
+
const indexTemplateFile = `${__dirname}/templates/index.js`;
+const iconObjectTemplateFile = `${__dirname}/templates/icon-object.js`;
+
+const indexTemplate = fs.readFileSync(indexTemplateFile, UTF8);
+const iconObjectTemplate = fs.readFileSync(iconObjectTemplateFile, UTF8);
const data = require(dataFile);
const { titleToFilename } = require("./utils");
@@ -27,27 +34,37 @@ function iconToKeyValue(icon) {
return `'${icon.title}':${iconToObject(icon)}`;
}
function iconToObject(icon) {
- return `{title:'${escape(icon.title)}',slug:'${escape(icon.slug)}',svg:'${escape(icon.svg)}',get path(){return this.svg.match(/ {
const filename = titleToFilename(icon.title);
- icon.svg = fs.readFileSync(`${iconsDir}/${filename}.svg`, "utf8");
+ icon.svg = fs.readFileSync(`${iconsDir}/${filename}.svg`, UTF8);
icon.slug = filename;
- icons.push(icon)
+ icons.push(icon);
// write the static .js file for the icon
- fs.writeFileSync(
- `${iconsDir}/${filename}.js`,
- `module.exports=${iconToObject(icon)};`
- );
+ const { error, code } = minify(`module.exports=${iconToObject(icon)};`);
+ if (error) {
+ console.error(error);
+ process.exit(1);
+ } else {
+ fs.writeFileSync(`${iconsDir}/${filename}.js`, code);
+ }
+
});
// write our generic index.js
-const indexTemplate = fs.readFileSync(indexTemplateFile, "utf8");
-const { error, code } = minify(util.format(indexTemplate, icons.map(iconToKeyValue).join(',')));
+const rawIndexJs = util.format(indexTemplate, icons.map(iconToKeyValue).join(','));
+const { error, code } = minify(rawIndexJs);
if (error) {
console.error(error);
process.exit(1);
diff --git a/scripts/templates/icon-object.js b/scripts/templates/icon-object.js
new file mode 100644
index 00000000..407316ea
--- /dev/null
+++ b/scripts/templates/icon-object.js
@@ -0,0 +1,10 @@
+{
+ title: '%s',
+ slug: '%s',
+ svg: '%s',
+ get path() {
+ return this.svg.match(/