1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-12-16 01:10:30 +02:00
Commit Graph

34 Commits

Author SHA1 Message Date
Álvaro Mondéjar Rubio
236f5fc715
Add types to source code (#10637) 2024-06-06 14:40:35 +02:00
LitoMore
bf69b6dee0
Add XO linter (#10643) 2024-03-24 18:38:18 +01:00
Álvaro Mondéjar
17ea889273
Refactor tests and scripts (#9237)
Co-authored-by: LitoMore <LitoMore@users.noreply.github.com>
2023-08-08 06:38:52 +02:00
Álvaro Mondéjar
6178243859
Expose SDK in NPM package (#8077) 2023-04-19 15:23:13 +02:00
LitoMore
119fdd812b
Workaround for icons in table (#8158)
* Workaround for icons in table

* Fix pattern of module URL
2022-12-21 12:32:32 +01:00
Álvaro Mondéjar
1fa10346a2
Use <picture> blocks for GH theme images in README (#7983)
* Visual manual test on Github

* Replace all images

* Fix error

* Merge with develop

* Upgrade strip-gh-theme-links action
2022-11-27 12:46:23 +01:00
LitoMore
3b141f1a25
Add aliases support for add-icon-data script (#7863)
Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>
2022-09-28 10:11:27 +08:00
LitoMore
5958fc117b
Add add-icon-data script (#7849)
Co-authored-by: Álvaro Mondéjar <mondejar1994@gmail.com>
2022-09-25 09:04:58 +08: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
Álvaro Mondéjar
ad7de0434e
Standarize locale comparisons and sort icons by title in package (#7854)
* Use Intl.Collator for locale comparisons

* Sort icons by title in package
2022-09-24 17:29:43 +02:00
Álvaro Mondéjar
b2cf3885ce
expose getIconsData* util functions (#7394) 2022-05-08 04:48:32 -07: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
44064880b4
Normalize newline characters reading README in scripts (#7292) 2022-03-31 05:30:30 -07: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
Álvaro Mondéjar
cc649017cc
Optimize titleToSlug function (#7073)
* Optimize `titleToSlug` function

* Use simpler regex initialization

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

* Simpler regex definition

* Run prettier

Co-authored-by: LitoMore <LitoMore@users.noreply.github.com>
2022-01-19 06:34:08 -08: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
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
Álvaro Mondéjar
f726999af2
Unify SVGs for HTML safe titles reporting encoding errors in linting (#6522)
* Basic implementation

* Fix error

* Update icons

* Tweak implementation

* Minor changes

* Apply suggested changes

* Don't encode 34 and 39 codepoints (double and single quotes)

* Fix comments
2021-10-02 16:46:07 +02:00
Peter Noble
ead1170a2f
Disallow Hyphens in File Names (#5121) 2021-05-05 11:22:54 +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
54f9ceff75
Disallow underscores in slugs & filenames (#4921) 2021-02-19 16:16:19 +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
Peter Noble
b9d229ff69
Add more characters to normalisation scripts (#4833)
* Update normalisation scripts

* Replace ß in index.html

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>
2021-02-03 00:06:49 +01:00
Peter Noble
41e7601a38
Remove Degree Symbol in Filenames (#4638) 2021-01-06 11:03:48 -05:00
Eric Cornelissen
7fb4ff6395
Fix low severity issues in the JavaScript (#3342) 2020-07-28 11:33:40 +01:00
Peter Noble
1afbec2d84
Additional Replacements for Filenames (#2625)
* Strip colons from filenames

* Add global matching for accented characters

* Add more replacements

* Added more diacritics

Namely: č,ć, ň, ń, ś, ž, ź

Co-authored-by: Lucas Becker <runxel@users.noreply.github.com>
2020-02-21 11:01:41 +00:00
Eric Cornelissen
287317b7b6 Lint the SVG's title content (#1508)
* Add custom SVGLint rule to lint the general <title> format

i.e. the <title> should be "[ICON_NAME] icon"

* Check if there exists an entry in simple-icons.json with the icon name

... found in the <title>

* Normalize all icons <title> value

* Fix mismatch between HTML's icon title and simple-icons.json title

... due to HTML special entities (such as `&amp;`). Affected icons:

- AT&T (AT&amp;T)
- Let's Encrypt (Let&apos;s Encrypt)

* Refactor .svglintrc.js

to make the code style more in line with scripts/prepublish.js

* Add SVG with invalid <title> format

* Add SVG with unknown title

* Revert 6912816 and f002504
2019-07-03 23:33:03 +02:00
David Klebanoff
1fb7581c55 Handle accented brand names (#1439)
* Handle accented brand names.

* Update order of replacement (alphabetic).
2019-05-28 23:56:20 +02:00
Eric Cornelissen
579d439e60
Lint file formatting (primarily whitespace) (#1349)
* Add editorconfig-checker and .editorconfig

* Fix wslint errors
2019-04-17 12:59:44 +03:00
Aaron Benjamin
038c558fab Add Apple Pay, AT&T, T-Mobile, Sprint, Verizon, Boost, Framer (#973)
* add new icons

- add icon for AT&T
- add icon for T-mobile
- add icon for Sprint
- add icon for Cricket
- add icon for Verizon
- add icon for Boost
- add icon for Framer
- add icon for Sketch
- Update _data/simple-icons.json with new icon data

* remove `<g>` from svg files

- remove `<g>` from svg files to address svglint error

* add apple pay

- Add apple pay
- Update simple-icons.json

* make changes per review

Changes were made based on review 9/9/18.

* fixed AT&T naming
2018-09-11 08:42:29 +02:00
Eric Cornelissen
b339df0b61 Update filemapping, ampersand (#977)
* Replace ampersand to avoid problems with filenames

Together with some examples as test

* Revert filename changes for testing purposes
2018-09-10 17:53:59 +02:00
Johan Fagerberg
6ee6ba977c
Add prepublish script (#942)
* Add prepublish script

Compiles icons into both static js files (icons/{filename}.js) and
into a static index.js. The latter is not tree-shakeable.

Closes #941, closes #751

* Add information on tree-shaking to README

* Remove index.js after publishing

* Change 'prepublish' to 'prepublishOnly'

* Link to webpack in README

* Simplify postpublish cleanup

Thanks @ericcornelissen

* Fix quote usage in prepublish.js

* Fix quote usage in utils.js

* Optimized file size of prepublish output

* Improved readability of prepublish script
2018-08-26 23:23:57 +02:00