diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..20db8b630a2f --- /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 6f9d1a82e501..c5cf27cf16b7 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 574f736a6631..b9318b418719 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 000000000000..eea4cf9a1bba --- /dev/null +++ b/icons/deepin.svg @@ -0,0 +1 @@ +deepin icon \ No newline at end of file diff --git a/icons/jet.svg b/icons/jet.svg new file mode 100644 index 000000000000..3c5c69707046 --- /dev/null +++ b/icons/jet.svg @@ -0,0 +1 @@ +JET icon \ No newline at end of file diff --git a/icons/realm.svg b/icons/realm.svg new file mode 100644 index 000000000000..d23862e09379 --- /dev/null +++ b/icons/realm.svg @@ -0,0 +1 @@ +Realm icon \ 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 000000000000..29a09b52f6c7 --- /dev/null +++ b/icons/socket-dot-io.svg @@ -0,0 +1 @@ +Socket.io icon \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 666818667348..b82d97198121 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 0c289ccfd871..4be8f846e888 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 287b2f2e06f8..74b5d78dc8e8 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 000000000000..407316ea7525 --- /dev/null +++ b/scripts/templates/icon-object.js @@ -0,0 +1,10 @@ +{ + title: '%s', + slug: '%s', + svg: '%s', + get path() { + return this.svg.match(/