1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2024-11-16 00:59:07 +02:00
Commit Graph

79 Commits

Author SHA1 Message Date
LitoMore
ab4fed9f82
Convert hex code to upper case in add-icon-data script (#8762) 2023-06-10 17:33:26 +02:00
LitoMore
7330e01f85
Add lint for checking redundant slashes (#8692)
* Add lint for checking redundant slashes

* Update function names

* Better condition

* Fix typo
2023-05-29 03:34:33 +02:00
LitoMore
e9c814ac00
Omit undefined properties (#8582) 2023-05-25 14:45:12 +02:00
LitoMore
a9a226c58a
Migrate inquirer to @inquirer/prompts (#8592) 2023-05-03 04:16:53 +02:00
LitoMore
8d05c7111b
Fix add-icon-data script (#8587) 2023-04-30 17:53:03 +08: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
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
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
d224a349fa
Fix aliases prompt (#7883) 2022-09-30 22:17:40 +08: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
LitoMore
fdc707bf81
Build icons in order (#7852) 2022-09-23 20:44:28 +02:00
Álvaro Mondéjar
e0a4e765ad
Reuse svg getter package template parts (#7457)
* Reuse svg getter package template parts
2022-05-27 15:09:33 +02:00
Sachin Raja
986589c34c
deprecate index (#7453) 2022-05-26 23:18:44 -07: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
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
Álvaro Mondéjar
ed4c29f7b6
Automatically update milestone (SVG count) in README (#6951)
* Automatically update milestone (SVG count) in README

* Use updateRange variale

* Rewrite 2 lines

* Simplify code

* Format new file

* Fix error in script

* Apply suggested changes
2021-12-09 17:02:58 -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
8010341b97
make building async and minify with esbuild (#6898)
* make building async and minify with esbuild

* switch from fs/promises to fs.promises

* cleanup fs.promises

* fix conflicts

* fix conflicts

* revert test file changes
2021-11-24 03:01:24 +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
Sachin Raja
1a77d28227
export bundled icons from one entry point and add types (#6767)
* export all icons from a single file (#6189)

* fix: revert formatting, add exports to package.json

* feat: generate icons.js and add relevant exports field

* add minifyAndWrite

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* fix: minifyAndWrite build

* add type: commonjs

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* simplify exports

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* add "require" in exports

* place objects directly in barrel file

* write exports minified

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* fix formatting

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* refactor slugToVariableName code into a function

* fix slugToVariableName

* change prefix to "si"

* move slugToVariableName to local helper functions

* unignore icons.js and icons.mjs

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* feat: add types (#6580)

* feat: add types

* fix linting error

* export default from types/index.d.ts

* minify

* revert formatting changes

* revert formatting change

* change paths from types/index.d.ts to index.d.ts

* mark icons.get as deprecated

* move type alias to another file

* update readme

* update readme.md

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* update typescript usage section

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* fix conflicts

* Apply suggestions from code review

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

* add writeTs function

Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>
2021-10-28 16:16:34 -07: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
LitoMore
8283daf05a
Drop package-lock.json (#6179)
* Drop `package-lock.json`

* Drop lockfile related code

* Drop lockfile maintenance configurations
2021-08-23 19:21:03 +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
153a029c25
Restructure the scripts/ directory (#5546)
* Restructure scripts/ directory

And update references to this scripts everywhere.

* Update names of file-level constants in bump-version.js

* Normalize quotes between all scripts

* Move "create-release.yml" scripts to scripts/release

* Move slugs table script to scripts/release

* Update relative path logic in update-slugs-table.js
2021-05-07 19:55:06 +02:00
Eric Cornelissen
e049e1d5a5
Auto update CDN URLs in README.md in release PR (#5545)
* Add script to bump major version in README

On lines 29-32, we could alternatively use `replaceAll`, I opted not to
as it is not yet(?) part of an LTS release of NodeJS.

* Bump CDN version in README automatically for new releases

* Rename "bump-cdn-version.js" to "update-cdn-urls.js"

* Update names of file-level constants in update-cdn-urls.js

* Rename workflow setp for updating CDN URLs

* Rename packageJsonFile constant in update-cdn-urls

* Remove semver dependency

* Generalize update-cdn-urls script
2021-05-05 23:29:49 +02:00
Peter Noble
ead1170a2f
Disallow Hyphens in File Names (#5121) 2021-05-05 11:22:54 +01:00
Eric Cornelissen
6c435fe741 Require Sorting by Slug (#5115)
#   Fix indentation of format function.
 #   Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>

 #   Update formatting in scripts/lint.js
 #   Co-authored-by: Eric Cornelissen <ericornelissen@gmail.com>
 #   Fix Handshake order
 #   Require Sorting by Slug
2021-04-16 18:05:44 +02:00
Álvaro Mondéjar
92006ed23e
Remove '.html' extension for SPDX license urls (#5412) 2021-04-15 17:33:25 +01:00
Eric Cornelissen
9fdbb57ccc
Add guidelines data to NPM package and documenation (#5342) 2021-03-26 09:33:04 +00:00
Eric Cornelissen
52a0c5b07b
Document slugs of brands (#5002) 2021-03-03 10:57:33 +00:00
Eric Cornelissen
95109ad629
Add license data to NPM package and documenation (#5106) 2021-03-02 12:01:31 +00: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
39269e7d39
Add icon license to JSON linting (and change JSON linting dependency) (#4945)
* Add "license" object to the data file JSON schema

* Add license to GNU and GNU social

As an example, based on the discussion in:
https://github.com/simple-icons/simple-icons/issues/1167

* Use `"additionalProperties": false` in JSON schema

... to detect properties in the data file that shouldn't be there.

For more info, see:
https://json-schema.org/understanding-json-schema/reference/object.html

* Update JSON scheme descriptions

* Switch from jsonlint2 to jsonschema

This gives is better support for advanced features of JSON schema.

A couple of clarifications:
- There does exist a jsonschema-cli package, but it is rather limited
  and crucially doens't exit with a non-zero exit code if there is an
  error. (it is also pretty old and not maintained), hence the custom
  script.
- I renamed .jsonlintschema 1) for clarity (lint is no longer accurate)
  and 2) the .json extension allows easy imorting in the script and 3)
  it adds syntax highlighting.
- The script outputs the number of errors in the end because the output
  gets pretty big pretty quickly, this way you can see it easily from
  your CLI.
- We could customize how the errors are logged, but I feel that is
  beyond this PR.

* Two minor changes

* Use `oneOf` to require URL for custom licenses

The updated configuration allows the `"license"` field to be either
1) a SPDX license, optional with a URL
2) a "custom" license with a required URL

Read more about the "oneOf" feature of jsonschema at:
https://json-schema.org/understanding-json-schema/reference/combining.html#oneof

* Include license field in Contributing Guidelines
2021-02-19 15:19:22 +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