1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-11-26 01:00:27 +02:00
Commit Graph

32 Commits

Author SHA1 Message Date
Sachin Raja
fcec7adc8b
replace index.js entry point (#8058)
* replace index.js entry point

* add types.d.ts

* Update documentation

* Add Typescript usage example

* Drop template file

* Readd test

* Minor change

Co-authored-by: Álvaro Mondéjar Rubio <mondejar1994@gmail.com>
2022-11-28 12:32:57 +01:00
Álvaro Mondéjar
3ee620b9d6
Forbid the usage of non secure URLs (#7855)
* Forbid the usage of non secure URLs

* Document in CONTRIBUTING

* Add test to forbid HTTP URLs in documentation pages
2022-09-24 17:37:03 +02:00
Tyler Miller
84c0149bba
Fix SVG linting errors (#7551)
* Remove newlines

* Remove newline to fix test

* Enforce `lf` line endings

* Remove trailing newline enforcement

* Remove `replace` to ensure no trailing newlines

* Revert "Enforce `lf` line endings"

This reverts commit 05a13db8c3.
2022-07-04 18:47:33 +02:00
Sachin Raja
665b82590d
remove icons/* entrypoints (#6788)
* remove icons/* entrypoints

* remove icons/* tests

* remove icons/* references from the README

* reference actual variable in README console.log

* merge develop

* fix conflicts

* fix

* fix tests

* Update scripts/build/package.js

* Update README.md

* fix ignore files
2022-05-26 14:29:37 +02:00
Álvaro Mondéjar
8f4e65ce28
Allow to use the function getThirdPartyExtensions at other locations (#7361) 2022-04-30 07:04:46 -07:00
Álvaro Mondéjar
dd4ddc7fa9
Avoid certain cases for data consistency (#7222) 2022-03-14 21:04:50 +01:00
Álvaro Mondéjar
6be07af824
Fix 3rd party extensions order, add test to avoid regression (#7111)
* Fix 3rd party extensions order and add test to avoid regression

* Prevent possible error in test

* Apply suggestions from code review

* Apply suggestion

* Remove uneeded import
2022-01-30 23:09:44 +01:00
Sachin Raja
d49492f1ef
switch from uvu to mocha (#7071)
* switch from uvu to mocha

* remove unused import

* custom min reporter

* use constants
2022-01-19 18:23:32 +01:00
Álvaro Mondéjar
8faa5b63bb
Fix some cases in README icons tests (#7056)
* Fix some cases in README icons tests

* Improve error message

* Declarate with `const` all variables
2022-01-15 14:27:42 -08:00
Alexandre Paradis
a253682eb8
Add some icons in Readme (#4816)
* Add some icons in Readme

* Align icons at left

* Add some more icons

* Remove inline image

- Use relative icons path

* Format Third Party Extensions
 as a table

* force website build

* added readme-icons foler with icons for the readme.md file, as well as icons for light and dark modes in the readme.md titles

* restored corrupted svgs for readme-icons

* moved the icons to asset/readme, added icons for Drawio, Hexo and Jetpack Compose

* - Use `develop` branch absolutified links for README images
- Strip dark image theme links before publish to Github and npm
- Clean third party extensions table

* Commit to tag (ony inside master branch)

* Fix differences in README

* Reintroduce link in README logo

* Drop uneeded newline from README

* Fix error in README

* Add newlines for SVGs

* Newlines for all SVGs

* Reuse black icons from library

* Commit using Github Actions bot

* Reuse diagrams.net library icon for white version

* Fix comment

* Bump 'strip-gh-theme-links' action to v2

* removed assets/readme icons

* Test with 'fill=white'

* Test with 'style="fill:white"'

* added filter:invert(1) to PHP, TS, Simple Icons and Blender

* added readme-icons test, changed the name of light icons in assets/readme

* reloaded icons in Readme

* fixed typo in iconsPath for readme-icons test

* fixed typo on the darkiconsPath resolution

* restored absolute paths

* minimized the white icons on assets/readme

* restored test scripts

* Apply changes

* Disable color output testing in CI

* Revert latest change

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>
Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>
Co-authored-by: Jorge Amado Soria Ramirez <darksoul.uci@gmail.com>
2022-01-09 15:04:36 -06:00
Sachin Raja
a930dc57ec
convert scripts to esm (#6946)
* convert scripts to esm

* fix tests

* fix tests

* fix lints

* syncFs to fsSync

* named export for fs

Co-authored-by: LitoMore <LitoMore@users.noreply.github.com>

* fsSync to { promises as fs }

* convert update-svgs-count to esm

* rename data to icons

* fix build script

* switch svglintrc file to mjs

* use node: protocol

* pluralize getIcons

Co-authored-by: LitoMore <LitoMore@users.noreply.github.com>
2021-12-25 06:22:56 -08:00
Álvaro Mondéjar
ebbd39bd32
Enforce <svg> node alphabetical attributes ordering (#6930) 2021-12-01 15:03:52 -08:00
Sachin Raja
a14e03cf7a
Switch testing framework from jest to uvu (#6915)
* switch from jest to uvu

* remove jest config

* convert index.test.js to uvu

* use assert.type

* Get rid of jest-diff

* Remove uneeded splits

* remove out.txt

* switch to fake-diff
2021-11-29 09:44:36 +01:00
Sachin Raja
ec75522f42
add deprecation warnings for icons/* imports (#6900)
* add deprecation warnings for icons/* imports

* do not log warnings during tests

* update message

Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>

* remove message formatting

* add jsdoc deprecation tags

* Update scripts/build/package.js

Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>

* Update scripts/build/package.js

Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>

* Update scripts/build/package.js

Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>

* Update scripts/build/package.js

Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>

* fix "use" for jsdoc

Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>
2021-11-23 12:33:37 -08:00
Eric Cornelissen
4c7b870af6
Remove .get from package's default export (#6820)
* Remove `.get` from package's default export

* Update TypeScript definitions

* Updated index.js test suite
2021-11-22 20:56:10 +01:00
Sachin Raja
7c8146e475
refactor: reorganize tests, reduce repetition (#6829)
* refactor: reorganize tests, reduce repetition

* fix conflicts

* fix conflicts

* remove unnecessary type checks and use toStrictEqual

* move index tests to separate file

* test svg values in testIcon
2021-11-08 11:55:47 +01:00
Álvaro Mondéjar
2d3485b8c1
Use getter for svg instead of path in packaged javascript version of icons (#6505)
* Use getter for 'svg' instead of 'path' in packaged javascript version of icons

* Use variable to avoid calling `escape` twice

* Convert title to HTML friendly in build script

* Update tests

* Only friendly title for SVG content

* Add equality test for SVG contents

* Add missing import

* Test using icons template

* Fix lint error

* Fix lint error in utils

* Read files synchronicly in tests

* Remove done from tests, make them pass

* Remove uneeded imports

* Remove replacements in tests

* Update with changes in develop

* Drop uneeded requirement

* Space between requirements

* Simplify encoding utility

* Fix syntax error

* Apply @ericcornelissen's suggestions

* Apply @ericcornelissen's suggestions
2021-11-06 16:03:37 +01:00
Eric Cornelissen
e0df400494
Setup prettier (#6758)
* Add prettier as a dependency

* Add format command and configure prettier

I opted for single quotes to be in line with other simple-icons projects

I ignore the data file because changing its formatting is quite a bit of
trouble for all open PRs.

* Run prettier

* Replace all functions by arrow functions

* Move prettier configuration to config file

Move it to a file so editors (and other software) can pick up on the
configuration. I went with .js because (a) it allows for comments and
(2) it seems most of the config files are in JavaScript already.

* Add prettier --check when running npm run lint (This adds it to the CI as well)

* Add husky and format changes before committing

* Use object destructuring for imports consistently

* Add shebang and fileoverview to jsonlint.js
2021-10-25 21:13:10 +02:00
Eric Cornelissen
f6b60e428f
Rename 'get' to 'Get' on simpleIcons export (#5777) 2021-05-28 11:16:50 +01:00
Eric Cornelissen
c66b8bc2f3
Remove get-by-title from NPM package API (#4920) 2021-05-25 17:40:11 +01:00
Eric Cornelissen
b2b036148f
Update NPM test suite (#5370)
* Test if icons have "guidelines" when they should

... and don't when they shouldn't.

* Update paht test in icons.test.js

* Improve test names and test conditions

* Test if icons have a "license" when they should

... and don't when they shouldn't.

* Test value of guidelines

Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>

* Test if SPDX license URL is a URL indeed

Using the same regular expression as we use for URLs in the JSON data
(see .jsonschema.json#url).
2021-04-06 16:53:46 +02:00
Álvaro Mondéjar
078ad4d714
Ensure that icon paths start with moveto command (#5069) 2021-02-22 17:20:07 +01:00
Eric Cornelissen
8431fd9683
Simplify how scripts get icon slugs (#5066)
* Accept icon rather than title in `iconToSlug`

This removes the need in (most of the) calls to this function to
seperately check if there is a custom slug already defined for the icon.

* Rename `titleToSlug` to `getIconSlug`

* Revert unnecessary style change

* Update function documentation

* Keep `titleToSlug` and add `getIconSlug` helper

Unfortunately `this` is not available because we're using arrow syntax
for these functions, but refering to `titleToSlug` through
`module.exports` works fine as well.

* Fix parameter name in `getIconSlug` docs
2021-02-22 14:15:37 +01:00
Eric Cornelissen
9c029bc706
Allow custom slugs (#4918) 2021-02-19 13:06:43 +00:00
Eric Cornelissen
8ecfcafeba
Refactor scripts in scripts/ (#4931)
- Rename `titleToFilename` to `titleToSlug`
- Fix indentation where necessary
- Use quotes internally consistently (to reduce the diff size, unfortunately this is the opposite quote from what we use in other projects)
- Update comments & documentation
- Construct file paths

And more...
2021-02-08 17:14:31 +01:00
Álvaro Mondéjar
6a07e9cfea
Allow exponential notation with E uppercase inside icon paths (#3843) 2020-11-18 18:57:25 +01:00
Álvaro Mondéjar
f358b1c27e
Allow exponential notation inside icons paths (#2946) 2020-04-18 13:24:53 +03:00
Eric Cornelissen
b1b2f339b8 Don't enumerate the get method (#1555)
* Test that all elements when iterating simpleIcons are objects

* Refactor index template to hide .get method from enumeration
2019-07-24 21:17:46 +02:00
Eric Cornelissen
c6a9346985 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"
2019-07-14 21:05:38 +02:00
Eric Cornelissen
9ebc626ab5 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"
2019-07-14 20:09:34 +02:00
Eric Cornelissen
30cd9ecc99 Add "path" key with raw path data to NPM package (#1472)
* Update prepublish script to add path to generated .js files

* Test generated path values

* Fix Furry Network icon

The Furry Network icon used to have "e"s in the path, however the 
official SVG definition does not specify the E command.

source: https://www.w3schools.com/graphics/svg_path.asp
2019-06-15 22:31:23 +02:00
Eric Cornelissen
e6485072d2 Test the NPM package (#972)
* Implement basic test for the NPM package

Just an initial test suite that checks if all promised imports actually 
exist. The testing framework Jest was chosen because of it ease of setup 
and use.

* Implement exhaustive tests of properties for each icon
2018-09-09 21:58:53 +02:00