From 39b8fdfa85ed367cd8cc7b3a043d20d0d875b848 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 14 Jul 2019 16:07:24 +0100 Subject: [PATCH 01/19] Reduce impact of path value on package size (#1521) * Reduce package size by replacing JSON.stringify by custom stringify func * Replace path data by getter * Replace getter by Object.defineProperty * Remove icon.path definition * Revert 801c07d4 Apperantly getters have better support then Objct.defineProperty... --- scripts/prepublish.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/prepublish.js b/scripts/prepublish.js index db663d7d8..9e07eedf8 100755 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -15,18 +15,28 @@ const fs = require("fs"); const { titleToFilename } = require("./utils"); -const icons = {}; +// Local helper functions +function iconToKeyValue(icon) { + return `'${icon.title}':${iconToObject(icon)}`; +} +function iconToObject(icon) { + return `{title:'${icon.title}',svg:'${icon.svg}',get path(){return this.svg.match(/ { const filename = titleToFilename(icon.title); icon.svg = fs.readFileSync(`${iconsDir}/${filename}.svg`, "utf8"); - icon.path = icon.svg.match(/ Date: Sun, 14 Jul 2019 21:08:50 +0300 Subject: [PATCH 02/19] =?UTF-8?q?Added=20Dassault=20Syst=C3=A8mes=20Icon?= =?UTF-8?q?=20(#1525)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added Dassault Systèmes * Update simple-icons.json * Rename dassaultsystèmes.svg to dassaultsystemes.svg * Dassault Systémes updated to Dassault Systemes * Update _data/simple-icons.json * Final newline removed --- _data/simple-icons.json | 5 +++++ icons/dassaultsystemes.svg | 1 + 2 files changed, 6 insertions(+) create mode 100644 icons/dassaultsystemes.svg diff --git a/_data/simple-icons.json b/_data/simple-icons.json index d5fab2f3c..e7c826d64 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -615,6 +615,11 @@ "hex": "0066DC", "source": "http://press.dailymotion.com/?page_id=346" }, + { + "title": "Dassault Systèmes", + "hex": "005386", + "source": "https://www.3ds.com/statics/menu/2/assets/img/logo/3ds-dark.svg" + }, { "title": "DAZN", "hex": "F8F8F5", diff --git a/icons/dassaultsystemes.svg b/icons/dassaultsystemes.svg new file mode 100644 index 000000000..919c0a443 --- /dev/null +++ b/icons/dassaultsystemes.svg @@ -0,0 +1 @@ +Dassault Systèmes icon \ No newline at end of file From 9ebc626ab5b4be5481f147a79409ad46f48c4d19 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 14 Jul 2019 19:09:34 +0100 Subject: [PATCH 03/19] Add URL friendy/slugged name as property to package icon objects (#1520) * Add URL friendy/slug/file name as property to package icon objects * Test new property * Add 'name' property to examples in README * Rename "name" property to "slug" --- README.md | 2 ++ scripts/prepublish.js | 3 ++- tests/icons.test.js | 4 ++++ tests/index.test.js | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 21a7d9517..cce2fe71a 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ console.log(simpleIcons['Simple Icons']); /* { title: 'Simple Icons', + slug: 'simpleicons', hex: '111111', source: 'https://simpleicons.org/', svg: '...', @@ -66,6 +67,7 @@ console.log(icon); /* { title: 'Simple Icons', + slug: 'simpleicons', hex: '111111', source: 'https://simpleicons.org/', svg: '...', diff --git a/scripts/prepublish.js b/scripts/prepublish.js index 9e07eedf8..709547975 100755 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -20,7 +20,7 @@ function iconToKeyValue(icon) { return `'${icon.title}':${iconToObject(icon)}`; } function iconToObject(icon) { - return `{title:'${icon.title}',svg:'${icon.svg}',get path(){return this.svg.match(/ { const filename = titleToFilename(icon.title); icon.svg = fs.readFileSync(`${iconsDir}/${filename}.svg`, "utf8"); + icon.slug = filename; icons.push(icon) // write the static .js file for the icon diff --git a/tests/icons.test.js b/tests/icons.test.js index a0d3bf759..f3e551f08 100644 --- a/tests/icons.test.js +++ b/tests/icons.test.js @@ -26,4 +26,8 @@ icons.forEach(icon => { expect(typeof subject.path).toBe('string'); expect(subject.path).toMatch(/[MmZzLlHhVvCcSsQqTtAa0-9-,.\s]/g); }); + + test(`${icon.title} has a "slug"`, () => { + expect(typeof subject.slug).toBe('string'); + }); }); diff --git a/tests/index.test.js b/tests/index.test.js index 2daf82a84..fcec89377 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -25,4 +25,8 @@ icons.forEach(icon => { expect(typeof subject.path).toBe('string'); expect(subject.path).toMatch(/^[MmZzLlHhVvCcSsQqTtAa0-9-,.\s]+$/g); }); + + test(`${icon.title} has a "slug"`, () => { + expect(typeof subject.slug).toBe('string'); + }); }); From e1c7f209147f457efbe06c0de63da2b9fb74795b Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 14 Jul 2019 20:03:41 +0100 Subject: [PATCH 04/19] Audit dependencies (#1526) Before when running `npm install` it would report "Found 1110 high severity vulnerabilities [...]". This updates the dependencies in package-lock.json, resultin in 0 vulnerabilities. --- package-lock.json | 43 ++++++++++--------------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba525a1e7..10cb86f5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4030,9 +4030,9 @@ } }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -4940,9 +4940,9 @@ "dev": true }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -5651,38 +5651,15 @@ "dev": true }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "unique-string": { From c6a9346985af70b8f1905823a561bf12c9630c6c Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 14 Jul 2019 20:05:38 +0100 Subject: [PATCH 05/19] Generic get icon function for easier access to brands with "difficult" names (#1522) * Add URL friendy/slug/file name as property to package icon objects * Test new property * Build index from template * Add .get function to index.js export * Test new .get function in index.js export * Use Uglify-JS to minify the code in the package's index.js * Update API in README.md * Renaem test using "slug" instead of "name" --- README.md | 2 +- package-lock.json | 7 ++----- package.json | 3 ++- scripts/prepublish.js | 17 +++++++++++++---- scripts/templates/index.js | 17 +++++++++++++++++ tests/index.test.js | 14 ++++++++++++++ 6 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 scripts/templates/index.js diff --git a/README.md b/README.md index cce2fe71a..5e973f0f6 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ The API can then be used as follows: ```javascript const simpleIcons = require('simple-icons'); -console.log(simpleIcons['Simple Icons']); +console.log(simpleIcons.get('Simple Icons')); /* { diff --git a/package-lock.json b/package-lock.json index 10cb86f5b..587959444 100644 --- a/package-lock.json +++ b/package-lock.json @@ -868,8 +868,7 @@ "version": "2.20.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true, - "optional": true + "dev": true }, "compare-versions": { "version": "3.4.0", @@ -5629,7 +5628,6 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", "dev": true, - "optional": true, "requires": { "commander": "~2.20.0", "source-map": "~0.6.1" @@ -5639,8 +5637,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "optional": true + "dev": true } } }, diff --git a/package.json b/package.json index 44a4c7277..e9d1363d2 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "editorconfig-checker": "^2.0.8", "jest": "^24.1.0", "jsonlint2": "^1.7.1", - "svglint": "^1.0.4" + "svglint": "^1.0.4", + "uglify-js": "^3.6.0" }, "scripts": { "jsonlint": "jsonlint _data/simple-icons.json -q -V .jsonlintschema", diff --git a/scripts/prepublish.js b/scripts/prepublish.js index 709547975..7fa7e1e20 100755 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -7,12 +7,16 @@ * Also generates an index.js that exports all icons by title, but is not tree-shakeable */ +const fs = require("fs"); +const util = require("util"); +const minify = require("uglify-js").minify; + const dataFile = "../_data/simple-icons.json"; const indexFile = `${__dirname}/../index.js`; const iconsDir = `${__dirname}/../icons`; -const data = require(dataFile); -const fs = require("fs"); +const indexTemplateFile = `${__dirname}/templates/index.js`; +const data = require(dataFile); const { titleToFilename } = require("./utils"); // Local helper functions @@ -39,5 +43,10 @@ data.icons.forEach(icon => { }); // write our generic index.js -const iconsString = icons.map(iconToKeyValue).join(','); -fs.writeFileSync(indexFile, `module.exports={${iconsString}};`); +const indexTemplate = fs.readFileSync(indexTemplateFile, "utf8"); +const { error, code } = minify(util.format(indexTemplate, icons.map(iconToKeyValue).join(','))); +if (error) { + process.exit(1); +} else { + fs.writeFileSync(indexFile, code); +} diff --git a/scripts/templates/index.js b/scripts/templates/index.js new file mode 100644 index 000000000..8dda40576 --- /dev/null +++ b/scripts/templates/index.js @@ -0,0 +1,17 @@ +var icons = {%s}; + +module.exports = icons; +module.exports.get = function(targetName) { + if (icons[targetName]) { + return icons[targetName]; + } else { + var normalizedName = targetName.toLowerCase(); + for (var iconName in icons) { + var icon = icons[iconName]; + if ((icon.title && icon.title.toLowerCase() === normalizedName) + || (icon.slug && icon.slug === normalizedName)) { + return icon; + } + } + } +} diff --git a/tests/index.test.js b/tests/index.test.js index fcec89377..f040045bd 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -1,5 +1,6 @@ const { icons } = require('../_data/simple-icons.json'); const simpleIcons = require('../index.js'); +const { titleToFilename } = require("../scripts/utils.js"); icons.forEach(icon => { const subject = simpleIcons[icon.title]; @@ -29,4 +30,17 @@ icons.forEach(icon => { test(`${icon.title} has a "slug"`, () => { expect(typeof subject.slug).toBe('string'); }); + + test(`${icon.title} can be found by it's title`, () => { + const found = simpleIcons.get(icon.title); + expect(found).toBeDefined(); + expect(found.title).toEqual(icon.title); + }); + + test(`${icon.title} can be found by it's slug`, () => { + const name = titleToFilename(icon.title); + const found = simpleIcons.get(name); + expect(found).toBeDefined(); + expect(found.title).toEqual(icon.title); + }); }); From 7672bfb2dbd0fa89bfa9d45c1749d288a1c48093 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 14 Jul 2019 20:15:26 +0100 Subject: [PATCH 06/19] Reduce package size by replacing JSON.stringify (#1519) * Reduce package size by replacing JSON.stringify by custom stringify func * Escape icon's title and SVG value ... as pointed out by @birjolaxew, if they contain a "'" it will break the resulting object. --- scripts/prepublish.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/prepublish.js b/scripts/prepublish.js index 7fa7e1e20..e891776a9 100755 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -20,11 +20,14 @@ const data = require(dataFile); const { titleToFilename } = require("./utils"); // Local helper functions +function escape(value) { + return value.replace(/'/g, "\\'"); +} function iconToKeyValue(icon) { return `'${icon.title}':${iconToObject(icon)}`; } function iconToObject(icon) { - return `{title:'${icon.title}',slug:'${icon.slug}',svg:'${icon.svg}',get path(){return this.svg.match(/ Date: Mon, 15 Jul 2019 14:19:25 +0200 Subject: [PATCH 07/19] Added Solus icon (#1529) (#1530) --- _data/simple-icons.json | 5 +++++ icons/solus.svg | 1 + 2 files changed, 6 insertions(+) create mode 100644 icons/solus.svg diff --git a/_data/simple-icons.json b/_data/simple-icons.json index e7c826d64..c6b0610c0 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -2580,6 +2580,11 @@ "hex": "FB6022", "source": "https://www.sogou.com/" }, + { + "title": "Solus", + "hex": "5294E2", + "source": "https://getsol.us/branding/" + }, { "title": "Songkick", "hex": "F80046", diff --git a/icons/solus.svg b/icons/solus.svg new file mode 100644 index 000000000..7f79d2826 --- /dev/null +++ b/icons/solus.svg @@ -0,0 +1 @@ +Solus icon \ No newline at end of file From 3af76b75d37a9c40e3f5cbcc38835ebebf1cea77 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Mon, 15 Jul 2019 15:14:50 +0100 Subject: [PATCH 08/19] Add NPM script to perform SVGO optimization from the repository (#1476) * Add SVGO as devDependencies and a NPM script to run it * Update Contributing Guidelines Change the instructions on how to use SVGO to optimize SVGs to use the new dependency and NPM script. * Add configuration for the NPM command to optimize SVGs * Specify --precision in SVGO configuration file * Update SVGO config ordering of attributes To be in line with the fact that, as @davidklebanoff pointed out: "most (all?) have the attributes in the order of role, viewbox, xmlns (alphabetical)" * Move SVGO --multipass argument to .svgo.yml * Update SVGO dependency to 1.3.0 Now the force merge option works :tada: See: https://github.com/svg/svgo/releases/tag/v1.3.0 * Update outdated "blocking" comment --- .svgo.yml | 74 +++++++++++++++++++ CONTRIBUTING.md | 7 +- package-lock.json | 183 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 4 +- 4 files changed, 263 insertions(+), 5 deletions(-) create mode 100644 .svgo.yml diff --git a/.svgo.yml b/.svgo.yml new file mode 100644 index 000000000..aadc25369 --- /dev/null +++ b/.svgo.yml @@ -0,0 +1,74 @@ +multipass: true + +plugins: + # Set precision to 3 decimal places + - convertPathData: + floatPrecision: 3 + + # Sort attributes on the + - sortAttrs: + order: + - role + - viewBox + xmlnsOrder: end + + # Convert basic shapes (such as ) to , including + - convertShapeToPath: + convertArcs: true + + # Compound all s into one + - mergePaths: + force: true + + # Keep the + - removeTitle: false + + # Don't remove the role="img" attribute and automatically + # add it to the SVG if it's not + - addAttributesToSVGElement: + attributes: + - role: img + - removeUnknownsAndDefaults: + keepRoleAttr: true + + # Enable everything else + - removeDoctype + - removeXMLProcInst + - removeComments + - removeMetadata + - removeXMLNS + - removeEditorsNSData + - cleanupAttrs + - inlineStyles + - minifyStyles + - convertStyleToAttrs + - cleanupIDs + - prefixIds + - removeRasterImages + - removeUselessDefs + - cleanupNumericValues + - cleanupListOfValues + - convertColors + - removeNonInheritableGroupAttrs + - removeUselessStrokeAndFill + - removeViewBox + - cleanupEnableBackground + - removeHiddenElems + - removeEmptyText + - moveElemsAttrsToGroup + - moveGroupAttrsToElems + - collapseGroups + - convertTransform + - removeEmptyAttrs + - removeEmptyContainers + - removeUnusedNS + - removeDesc + - removeDimensions + - removeAttrs + - removeAttributesBySelector + - removeElementsByAttr + - addClassesToSVGElement + - removeStyleElement + - removeScriptElement + - removeOffCanvasPaths + - reusePaths diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 23339721a..b917f40ca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,10 +74,9 @@ Using your preferred tool you should: All icons in Simple Icons have been optimized with the [SVGO tool](https://github.com/svg/svgo). This can be done in one of two ways: * The [SVGO Command Line Tool](https://github.com/svg/svgo) - * Install SVGO - * With npm: `npm install -g svgo` - * With Homebrew: `brew install svgo` - * Run the following command `svgo --precision=3 -i icon.svg -o icon.min.svg` + * Install dependencies + * With npm: `npm install` from the root of this repository + * Run the following command `npm run svgo -- icons/file-to-optimize.svg` * Check if there is a loss of quality in the output, if so increase the precision. * The [SVGOMG Online Tool](https://jakearchibald.github.io/svgomg/) * Click "Open SVG" and select an SVG file. diff --git a/package-lock.json b/package-lock.json index 587959444..b072556f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -187,6 +187,12 @@ "integrity": "sha512-rx29MMkRdVmzunmiA4lzBYJNnXsW/PhG4kMBy2ATsYaDjGGR75dCFEVVROKpNwlVdcUX3xxlghKQOeDPBJobng==", "dev": true }, + "@types/q": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", + "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==", + "dev": true + }, "JSV": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz", @@ -824,6 +830,39 @@ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, + "coa": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", + "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", + "dev": true, + "requires": { + "@types/q": "^1.5.1", + "chalk": "^2.4.1", + "q": "^1.1.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -954,12 +993,55 @@ "nth-check": "~1.0.1" } }, + "css-select-base-adapter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", + "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", + "dev": true + }, + "css-tree": { + "version": "1.0.0-alpha.33", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.33.tgz", + "integrity": "sha512-SPt57bh5nQnpsTBsx/IXbO14sRc9xXu5MtMAVuo0BaQQmyf0NupNPPSoMaqiAF5tDFafYsTkfeH4Q/HCKXkg4w==", + "dev": true, + "requires": { + "mdn-data": "2.0.4", + "source-map": "^0.5.3" + } + }, "css-what": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.3.tgz", "integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==", "dev": true }, + "csso": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/csso/-/csso-3.5.1.tgz", + "integrity": "sha512-vrqULLffYU1Q2tLdJvaCYbONStnfkfimRxXNaGjxMldI0C7JPBC4rB1RyjhfdZ4m1frm8pM9uRPKH3d2knZ8gg==", + "dev": true, + "requires": { + "css-tree": "1.0.0-alpha.29" + }, + "dependencies": { + "css-tree": { + "version": "1.0.0-alpha.29", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.29.tgz", + "integrity": "sha512-sRNb1XydwkW9IOci6iB2xmy8IGCj6r/fr+JWitvJ2JxQRPzN3T4AGGVWCMlVmVwM1gtgALJRmGIlWv5ppnGGkg==", + "dev": true, + "requires": { + "mdn-data": "~1.1.0", + "source-map": "^0.5.3" + } + }, + "mdn-data": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-1.1.4.tgz", + "integrity": "sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA==", + "dev": true + } + } + }, "cssom": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz", @@ -3908,6 +3990,12 @@ "object-visit": "^1.0.0" } }, + "mdn-data": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", + "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", + "dev": true + }, "mem": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", @@ -4301,6 +4389,18 @@ "isobject": "^3.0.1" } }, + "object.values": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.0.tgz", + "integrity": "sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.12.0", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -4628,6 +4728,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", @@ -5229,6 +5335,12 @@ "tweetnacl": "~0.14.0" } }, + "stable": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", + "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", + "dev": true + }, "stack-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", @@ -5400,6 +5512,71 @@ } } }, + "svgo": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.0.tgz", + "integrity": "sha512-MLfUA6O+qauLDbym+mMZgtXCGRfIxyQoeH6IKVcFslyODEe/ElJNwr0FohQ3xG4C6HK6bk3KYPPXwHVJk3V5NQ==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "coa": "^2.0.2", + "css-select": "^2.0.0", + "css-select-base-adapter": "^0.1.1", + "css-tree": "1.0.0-alpha.33", + "csso": "^3.5.1", + "js-yaml": "^3.13.1", + "mkdirp": "~0.5.1", + "object.values": "^1.1.0", + "sax": "~1.2.4", + "stable": "^0.1.8", + "unquote": "~1.1.1", + "util.promisify": "~1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "css-select": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.0.2.tgz", + "integrity": "sha512-dSpYaDVoWaELjvZ3mS6IKZM/y2PMPa/XYoEfYNZePL4U/XgyxZNroHEHReDx/d+VgXh9VbCTtFqLkFbmeqeaRQ==", + "dev": true, + "requires": { + "boolbase": "^1.0.0", + "css-what": "^2.1.2", + "domutils": "^1.7.0", + "nth-check": "^1.0.2" + } + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + } + } + }, "symbol-tree": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", @@ -5668,6 +5845,12 @@ "crypto-random-string": "^1.0.0" } }, + "unquote": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", + "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", + "dev": true + }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", diff --git a/package.json b/package.json index e9d1363d2..581177fcd 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "jest": "^24.1.0", "jsonlint2": "^1.7.1", "svglint": "^1.0.4", + "svgo": "^1.3.0", "uglify-js": "^3.6.0" }, "scripts": { @@ -32,6 +33,7 @@ "postpublish": "rm icons/*.js index.js", "test": "jest", "pretest": "npm run prepublishOnly", - "posttest": "npm run postpublish" + "posttest": "npm run postpublish", + "svgo": "svgo --config=./.svgo.yml" } } From b4b1a5815229786fd7a26febf2f38d2b0d9b1280 Mon Sep 17 00:00:00 2001 From: Oleg Nenashev Date: Mon, 15 Jul 2019 20:06:05 +0200 Subject: [PATCH 09/19] New Icon: Cloudbees (#1518) * Add cloudbees.svg * Add JSON metadata for CloudBees * Add missing space in JSON * Update cloudbees.svg * Update cloudbees.svg * Remove the endline in cloudbees.svg * Upload cloudbees.svg without endline break using GitHub Web UI --- Closes #1517 --- _data/simple-icons.json | 5 +++++ icons/cloudbees.svg | 1 + 2 files changed, 6 insertions(+) create mode 100644 icons/cloudbees.svg diff --git a/_data/simple-icons.json b/_data/simple-icons.json index c6b0610c0..f88ebc40e 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -455,6 +455,11 @@ "hex": "5881D8", "source": "https://commons.wikimedia.org/wiki/File:Clojure_logo.svg" }, + { + "title": "CloudBees", + "hex": "1997B5", + "source": "https://www.cloudbees.com/" + }, { "title": "Cloudflare", "hex": "F38020", diff --git a/icons/cloudbees.svg b/icons/cloudbees.svg new file mode 100644 index 000000000..1d5475581 --- /dev/null +++ b/icons/cloudbees.svg @@ -0,0 +1 @@ +CloudBees icon \ No newline at end of file From 979e401f918f5091a2ad665fe21692fc49304b22 Mon Sep 17 00:00:00 2001 From: Fatih Mehmet Ozcan <34105974+fatihmeh@users.noreply.github.com> Date: Mon, 15 Jul 2019 23:25:44 +0300 Subject: [PATCH 10/19] New icons (Boeing, Iata, Turkish Airlines) (#1527) * 4 new icon Boeing, Iata, Turkish Airlines, Virgin Icons Added * Delete virgin.svg * Update simple-icons.json * Hex values update to be uppercase --- _data/simple-icons.json | 15 +++++++++++++++ icons/boeing.svg | 1 + icons/iata.svg | 1 + icons/turkishairlines.svg | 1 + 4 files changed, 18 insertions(+) create mode 100644 icons/boeing.svg create mode 100644 icons/iata.svg create mode 100644 icons/turkishairlines.svg diff --git a/_data/simple-icons.json b/_data/simple-icons.json index f88ebc40e..bb0fb5afd 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -340,6 +340,11 @@ "hex": "FF5722", "source": "https://www.blogger.com" }, + { + "title": "Boeing", + "hex": "1D439C", + "source": "https://upload.wikimedia.org/wikipedia/commons/4/4f/Boeing_full_logo.svg" + }, { "title": "Boost", "hex": "F69220", @@ -1345,6 +1350,11 @@ "hex": "CC2929", "source": "https://support.humblebundle.com/hc/en-us/articles/202742060-Bundle-Logos" }, + { + "title": "Iata", + "hex": "004E81", + "source": "https://upload.wikimedia.org/wikipedia/commons/f/f7/IATAlogo.svg" + }, { "title": "iCloud", "hex": "3693F3", @@ -2925,6 +2935,11 @@ "hex": "36465D", "source": "https://www.tumblr.com/logo" }, + { + "title": "Turkish Airlines", + "hex": "C70A0C", + "source": "https://www.turkishairlines.com/tr-int/basin-odasi/logo-arsivi/index.html" + }, { "title": "Twilio", "hex": "F22F46", diff --git a/icons/boeing.svg b/icons/boeing.svg new file mode 100644 index 000000000..126d0c3c4 --- /dev/null +++ b/icons/boeing.svg @@ -0,0 +1 @@ +Boeing icon \ No newline at end of file diff --git a/icons/iata.svg b/icons/iata.svg new file mode 100644 index 000000000..a4fcba142 --- /dev/null +++ b/icons/iata.svg @@ -0,0 +1 @@ +Iata icon \ No newline at end of file diff --git a/icons/turkishairlines.svg b/icons/turkishairlines.svg new file mode 100644 index 000000000..672204937 --- /dev/null +++ b/icons/turkishairlines.svg @@ -0,0 +1 @@ +Turkish Airlines icon \ No newline at end of file From 54bd5c26287172bd0d14583469262d16166ab9a7 Mon Sep 17 00:00:00 2001 From: Fatih Mehmet Ozcan <34105974+fatihmeh@users.noreply.github.com> Date: Tue, 16 Jul 2019 08:51:46 +0300 Subject: [PATCH 11/19] Unreal Engine Icon Added (#1528) --- _data/simple-icons.json | 5 +++++ icons/unrealengine.svg | 1 + 2 files changed, 6 insertions(+) create mode 100644 icons/unrealengine.svg diff --git a/_data/simple-icons.json b/_data/simple-icons.json index bb0fb5afd..503428a44 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -3010,6 +3010,11 @@ "hex": "000000", "source": "https://unity.com/" }, + { + "title": "Unreal Engine", + "hex": "313131", + "source": "https://www.unrealengine.com/en-US/branding" + }, { "title": "Unsplash", "hex": "000000", diff --git a/icons/unrealengine.svg b/icons/unrealengine.svg new file mode 100644 index 000000000..7e23f2ff5 --- /dev/null +++ b/icons/unrealengine.svg @@ -0,0 +1 @@ +Unreal Engine icon \ No newline at end of file From adaf2e606f87bcbb310816b6a35f7313979d72e1 Mon Sep 17 00:00:00 2001 From: David Klebanoff Date: Tue, 16 Jul 2019 00:34:59 -0700 Subject: [PATCH 12/19] Add Helm (#1534) * Add Helm * Fixed missing bracket on failed merge Closes #1533 --- _data/simple-icons.json | 5 +++++ icons/helm.svg | 1 + 2 files changed, 6 insertions(+) create mode 100644 icons/helm.svg diff --git a/_data/simple-icons.json b/_data/simple-icons.json index 503428a44..49a4e2b40 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -1280,6 +1280,11 @@ "hex": "EA8220", "source": "https://haxe.org/foundation/branding.html" }, + { + "title": "Helm", + "hex": "277A9F", + "source": "https://helm.sh" + }, { "title": "HERE", "hex": "48DAD0", diff --git a/icons/helm.svg b/icons/helm.svg new file mode 100644 index 000000000..e34c209ef --- /dev/null +++ b/icons/helm.svg @@ -0,0 +1 @@ +Helm icon \ No newline at end of file From abe0a8ca369fd6983d1bb06e47c9e71b308ff55b Mon Sep 17 00:00:00 2001 From: David Klebanoff Date: Wed, 17 Jul 2019 00:50:27 -0700 Subject: [PATCH 13/19] Added ORCID. (#1538) Closes #1537 --- _data/simple-icons.json | 5 +++++ icons/orcid.svg | 1 + 2 files changed, 6 insertions(+) create mode 100644 icons/orcid.svg diff --git a/_data/simple-icons.json b/_data/simple-icons.json index 49a4e2b40..9afaae1b5 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -2085,6 +2085,11 @@ "hex": "F80000", "source": "https://www.oracle.com/webfolder/s/brand/identity/index.html" }, + { + "title": "ORCID", + "hex": "A6CE39", + "source": "https://orcid.org/trademark-and-id-display-guidelines" + }, { "title": "Origin", "hex": "F56C2D", diff --git a/icons/orcid.svg b/icons/orcid.svg new file mode 100644 index 000000000..4ce63494a --- /dev/null +++ b/icons/orcid.svg @@ -0,0 +1 @@ +ORCID icon \ No newline at end of file From bfe67b61cd10018d00c00ecc850f7358667366bf Mon Sep 17 00:00:00 2001 From: David Klebanoff Date: Thu, 18 Jul 2019 00:40:51 -0700 Subject: [PATCH 14/19] Added Brave (#1543) Closes #1536 --- _data/simple-icons.json | 5 +++++ icons/brave.svg | 1 + 2 files changed, 6 insertions(+) create mode 100644 icons/brave.svg diff --git a/_data/simple-icons.json b/_data/simple-icons.json index 9afaae1b5..e2d07aa31 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -365,6 +365,11 @@ "hex": "0AA0FF", "source": "https://brand.ai/brand-ai/style" }, + { + "title": "Brave", + "hex": "FB542B", + "source": "https://brave.com/brave-branding-assets/" + }, { "title": "Buddy", "hex": "1A86FD", diff --git a/icons/brave.svg b/icons/brave.svg new file mode 100644 index 000000000..4318903fa --- /dev/null +++ b/icons/brave.svg @@ -0,0 +1 @@ +Brave icon \ No newline at end of file From ddd578c7accd46282120076fe559067f42b4a546 Mon Sep 17 00:00:00 2001 From: David Klebanoff Date: Thu, 18 Jul 2019 00:44:38 -0700 Subject: [PATCH 15/19] Update WebStorm. (#1544) Closes #1499 --- _data/simple-icons.json | 4 ++-- icons/webstorm.svg | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/_data/simple-icons.json b/_data/simple-icons.json index e2d07aa31..0e2a88924 100644 --- a/_data/simple-icons.json +++ b/_data/simple-icons.json @@ -3147,8 +3147,8 @@ }, { "title": "WebStorm", - "hex": "00CDD7", - "source": "https://www.jetbrains.com/company/brand/#section=images-logos" + "hex": "000000", + "source": "https://www.jetbrains.com/company/brand/logos/" }, { "title": "WeChat", diff --git a/icons/webstorm.svg b/icons/webstorm.svg index c188cd674..9a3c04341 100644 --- a/icons/webstorm.svg +++ b/icons/webstorm.svg @@ -1 +1 @@ -WebStorm icon \ No newline at end of file +WebStorm icon \ No newline at end of file From 77b4be945dcbd16a3cd4d70fe36454b3bbf65f5c Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 21 Jul 2019 19:46:37 +0100 Subject: [PATCH 16/19] Add error logging to prepublish script --- scripts/prepublish.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/prepublish.js b/scripts/prepublish.js index e891776a9..287b2f2e0 100755 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -49,6 +49,7 @@ data.icons.forEach(icon => { const indexTemplate = fs.readFileSync(indexTemplateFile, "utf8"); const { error, code } = minify(util.format(indexTemplate, icons.map(iconToKeyValue).join(','))); if (error) { + console.error(error); process.exit(1); } else { fs.writeFileSync(indexFile, code); From 63e3d3dc976d0a425782071753bb14a7f57f7bd4 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 21 Jul 2019 19:51:15 +0100 Subject: [PATCH 17/19] Ignore files generated by prepublish script in git --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 40af94beb..08cab173e 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,7 @@ Temporary Items # NPM dependencies node_modules/ + +# Files generated by build script +icons/*.js +/index.js From 1978e05c5ddd115ef445099cbe48bffa72e0f1e6 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Sun, 21 Jul 2019 20:44:51 +0100 Subject: [PATCH 18/19] 1.12.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b072556f0..821af15ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "simple-icons", - "version": "1.11.0", + "version": "1.12.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 581177fcd..109e35b32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-icons", - "version": "1.11.0", + "version": "1.12.0", "description": "SVG icons for popular brands https://simpleicons.org", "homepage": "https://www.simpleicons.org", "keywords": [ From 11cdbd707359535571e3f358b22eb67a35dbd0b2 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Mon, 22 Jul 2019 17:58:51 +0100 Subject: [PATCH 19/19] Add a "build" and "clean" NPM script (#1548) --- package.json | 6 ++++-- scripts/{prepublish.js => build-package.js} | 0 2 files changed, 4 insertions(+), 2 deletions(-) rename scripts/{prepublish.js => build-package.js} (100%) mode change 100755 => 100644 diff --git a/package.json b/package.json index 109e35b32..a1e7256c8 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,13 @@ "uglify-js": "^3.6.0" }, "scripts": { + "build": "node scripts/build-package.js", + "clean": "rm icons/*.js index.js", "jsonlint": "jsonlint _data/simple-icons.json -q -V .jsonlintschema", "svglint": "svglint icons/* --ci", "wslint": "editorconfig-checker --ignore", - "prepublishOnly": "node scripts/prepublish.js", - "postpublish": "rm icons/*.js index.js", + "prepublishOnly": "npm run build", + "postpublish": "npm run clean", "test": "jest", "pretest": "npm run prepublishOnly", "posttest": "npm run postpublish", diff --git a/scripts/prepublish.js b/scripts/build-package.js old mode 100755 new mode 100644 similarity index 100% rename from scripts/prepublish.js rename to scripts/build-package.js