diff --git a/.editorconfig b/.editorconfig index 5715afa794db..1645df351c03 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,15 +2,13 @@ root=true [*] charset=utf-8 +indent_size=2 +indent_style=space insert_final_newline=true +trim_trailing_whitespace=true -[LICENSE.md] +[*.md] indent_size=unset -indent_style=space - -[*.{json,yml}] -indent_size=2 -indent_style=space [*.svg] insert_final_newline=false @@ -20,4 +18,6 @@ trim_trailing_whitespace=false # Templates with trailing whitespace are more usa [_data/simple-icons.json] indent_size=4 -trim_trailing_whitespace=true + +[index.html] +indent_size=4 diff --git a/.gitattributes b/.gitattributes index 49f836af1f19..99078aeea07c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14,5 +14,4 @@ Gemfile.lock -diff # Don't export/archive these files .github export-ignore .gitpod.yml export-ignore -.travis.yml export-ignore CNAME export-ignore diff --git a/.github/labeler.yml b/.github/labeler.yml index 2359be4e2d0b..8b7031942748 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,6 +1,6 @@ new icon: -- any: [icons/*.svg] - status: 'added' + - any: [icons/*.svg] + status: added icon outdated: -- any: [icons/*.svg] - status: 'modified' + - any: [icons/*.svg] + status: modified diff --git a/.github/workflows/add-labels.yml b/.github/workflows/add-labels.yml index 5e2c9e8a0948..c372d2772971 100644 --- a/.github/workflows/add-labels.yml +++ b/.github/workflows/add-labels.yml @@ -7,6 +7,6 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: ericcornelissen/labeler@label-based-on-status - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: ericcornelissen/labeler@label-based-on-status + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index e5c0e76b0b2b..0eb115bfa6b3 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -8,6 +8,6 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: simple-icons/release-action@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: simple-icons/release-action@master + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/merge-release.yml b/.github/workflows/merge-release.yml index e5efe29a3450..d6c71728bae4 100644 --- a/.github/workflows/merge-release.yml +++ b/.github/workflows/merge-release.yml @@ -8,6 +8,6 @@ jobs: runs-on: ubuntu-latest if: contains(github.event.pull_request.labels.*.name, 'release') steps: - - uses: simple-icons/release-action@master - with: - repo-token: ${{ secrets.RELEASE_TOKEN }} + - uses: simple-icons/release-action@master + with: + repo-token: ${{ secrets.RELEASE_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d3b823107f15..363f7b86db6d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,82 +2,82 @@ name: Publish on: push: branches: - - master + - master jobs: npm: name: NPM Package runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Node.js 12.x - uses: actions/setup-node@v2 - with: - node-version: 12.x - - name: Install dependencies - run: npm ci - - name: Sanity check - run: | - npm run lint - npm run test - - name: Deploy to NPM - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js 12.x + uses: actions/setup-node@v2 + with: + node-version: 12.x + - name: Install dependencies + run: npm ci + - name: Sanity check + run: | + npm run lint + npm run test + - name: Deploy to NPM + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} github: name: GitHub release runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Node.js 12.x - uses: actions/setup-node@v2 - with: - node-version: 12.x - - name: Install dependencies - run: npm ci - - name: Sanity check - run: | - npm run lint - npm run test - - name: Get commit message (for release title and body) - id: commit - uses: kceb/git-message-action@v1 - - name: Get release title and body - id: release - run: | - COMMIT_MSG="$(echo "${{ steps.commit.outputs.git-message }}")" - RELEASE_TITLE="$(echo "$COMMIT_MSG" | head -n 1)" - echo "::set-output name=title::$RELEASE_TITLE" - RELEASE_BODY="$(echo "$COMMIT_MSG" | tail -n +3)" - echo "::set-output name=body::$RELEASE_BODY" - - name: Get release version - id: get-version - run: | - export PACKAGE_VERSION=$(cat package.json | grep 'version' | sed 's/[ \",:]//g' | sed 's/version//') - echo "::set-output name=version::$PACKAGE_VERSION" - - name: Create and push git tag - uses: actions-ecosystem/action-push-tag@v1 - with: - tag: ${{ steps.get-version.outputs.version }} - message: ${{ steps.commit.outputs.git-message }} - - name: Create release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.get-version.outputs.version }} - release_name: ${{ steps.release.outputs.title }} - body: ${{ steps.release.outputs.body }} + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js 12.x + uses: actions/setup-node@v2 + with: + node-version: 12.x + - name: Install dependencies + run: npm ci + - name: Sanity check + run: | + npm run lint + npm run test + - name: Get commit message (for release title and body) + id: commit + uses: kceb/git-message-action@v1 + - name: Get release title and body + id: release + run: | + COMMIT_MSG="$(echo "${{ steps.commit.outputs.git-message }}")" + RELEASE_TITLE="$(echo "$COMMIT_MSG" | head -n 1)" + echo "::set-output name=title::$RELEASE_TITLE" + RELEASE_BODY="$(echo "$COMMIT_MSG" | tail -n +3)" + echo "::set-output name=body::$RELEASE_BODY" + - name: Get release version + id: get-version + run: | + export PACKAGE_VERSION=$(cat package.json | grep 'version' | sed 's/[ \",:]//g' | sed 's/version//') + echo "::set-output name=version::$PACKAGE_VERSION" + - name: Create and push git tag + uses: actions-ecosystem/action-push-tag@v1 + with: + tag: ${{ steps.get-version.outputs.version }} + message: ${{ steps.commit.outputs.git-message }} + - name: Create release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.get-version.outputs.version }} + release_name: ${{ steps.release.outputs.title }} + body: ${{ steps.release.outputs.body }} font: name: Trigger simple-icons-font release needs: npm runs-on: ubuntu-latest steps: - - name: Trigger simple-icons-font release - run: | - curl -X POST \ - -H "Authorization: Bearer ${{ secrets.SIMPLE_ICONS_FONT_TOKEN }}" \ - -d '{"ref":"develop"}' \ - https://api.github.com/repos/simple-icons/simple-icons-font/actions/workflows/auto-release.yml/dispatches + - name: Trigger simple-icons-font release + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.SIMPLE_ICONS_FONT_TOKEN }}" \ + -d '{"ref":"develop"}' \ + https://api.github.com/repos/simple-icons/simple-icons-font/actions/workflows/auto-release.yml/dispatches diff --git a/.github/workflows/remove-labels.yml b/.github/workflows/remove-labels.yml index 031778e18891..c90d71c77c54 100644 --- a/.github/workflows/remove-labels.yml +++ b/.github/workflows/remove-labels.yml @@ -25,7 +25,6 @@ jobs: out of scope pending won't add - remove-closed-pr-labels: name: Remove closed pull request labels if: github.event_name == 'pull_request_target' && (! github.event.pull_request.merged) @@ -37,7 +36,6 @@ jobs: labels: | in discussion pending - remove-closed-issue-labels: name: Remove closed issue labels if: github.event.issue.state == 'closed' diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 5b054dd20dce..092e9f8339a9 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -6,45 +6,45 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Node.js 12.x - uses: actions/setup-node@v2 - with: - node-version: 12.x - - name: Install dependencies - run: npm ci - - name: Run linter - run: | - npm run jsonlint - npm run svglint - npm run wslint - npm run our-lint + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js 12.x + uses: actions/setup-node@v2 + with: + node-version: 12.x + - name: Install dependencies + run: npm ci + - name: Run linter + run: | + npm run jsonlint + npm run svglint + npm run wslint + npm run our-lint build: name: Build website runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - # https://github.com/ruby/setup-ruby/blob/master/README.md#caching-bundle-install-automatically - bundler-cache: true - - name: Build website - run: bundle exec jekyll build + - name: Checkout + uses: actions/checkout@v2 + - name: Use Ruby 2.7 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + # https://github.com/ruby/setup-ruby/blob/master/README.md#caching-bundle-install-automatically + bundler-cache: true + - name: Build website + run: bundle exec jekyll build test: name: Test package runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Node.js 12.x - uses: actions/setup-node@v2 - with: - node-version: 12.x - - name: Install dependencies - run: npm ci - - name: Run tests - run: npm run test + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js 12.x + uses: actions/setup-node@v2 + with: + node-version: 12.x + - name: Install dependencies + run: npm ci + - name: Run tests + run: npm run test diff --git a/.jsonlintschema b/.jsonlintschema index 63cb3c34aca5..6477aa04eebd 100644 --- a/.jsonlintschema +++ b/.jsonlintschema @@ -1,34 +1,34 @@ { - "title": "Simple Icons", - "type": "object", - "properties": { - "icons": { - "description": "The list of icons", - "type": "array", - "items": { - "description": "A single icon", - "type": "object", - "properties": { - "title": { - "description": "The icons name", - "type": "string", - "required": true - }, - "hex": { - "description": "The icons color, as HEX (without #)", - "type": "string", - "pattern": "^[0-9A-F]{6}$", - "required": true - }, - "source": { - "description": "The website from which the icon originated", - "type": "string", - "pattern": "^https?://[^\\s]+$", - "required": true - } - }, - "required": true - } - } + "title": "Simple Icons", + "type": "object", + "properties": { + "icons": { + "description": "The list of icons", + "type": "array", + "items": { + "description": "A single icon", + "type": "object", + "properties": { + "title": { + "description": "The icons name", + "type": "string", + "required": true + }, + "hex": { + "description": "The icons color, as HEX (without #)", + "type": "string", + "pattern": "^[0-9A-F]{6}$", + "required": true + }, + "source": { + "description": "The website from which the icon originated", + "type": "string", + "pattern": "^https?://[^\\s]+$", + "required": true + } + }, + "required": true + } } + } } diff --git a/.svglintrc.js b/.svglintrc.js index 8d8662fd6ad5..ce8d45e570c0 100644 --- a/.svglintrc.js +++ b/.svglintrc.js @@ -15,7 +15,7 @@ const iconMaxFloatPrecision = 5; const iconTolerance = 0.001; // set env SI_UPDATE_IGNORE to recreate the ignore file -const updateIgnoreFile = process.env.SI_UPDATE_IGNORE === 'true' +const updateIgnoreFile = process.env.SI_UPDATE_IGNORE === 'true'; const ignoreFile = "./.svglint-ignored.json"; const iconIgnored = !updateIgnoreFile ? require(ignoreFile) : {}; @@ -224,14 +224,14 @@ module.exports = { } } if (index > 0) { - let [yPrevCoord, xPrevCoord, ...prevRest] = [...absSegments[index - 1]].reverse(); + let [yPrevCoord, xPrevCoord] = [...absSegments[index - 1]].reverse(); // If the previous command was a direction one, we need to iterate back until we find the missing coordinates if (upperDirectionCommands.includes(xPrevCoord)) { xPrevCoord = undefined; yPrevCoord = undefined; let idx = index; while (--idx > 0 && (xPrevCoord === undefined || yPrevCoord === undefined)) { - let [yPrevCoordDeep, xPrevCoordDeep, ...rest] = [...absSegments[idx]].reverse(); + let [yPrevCoordDeep, xPrevCoordDeep] = [...absSegments[idx]].reverse(); // If the previous command was a horizontal movement, we need to consider the single coordinate as x if (upperHorDirectionCommand === xPrevCoordDeep) { xPrevCoordDeep = yPrevCoordDeep; @@ -315,7 +315,7 @@ module.exports = { if (!updateIgnoreFile && isIgnored(reporter.name, iconPath)) { return; } - + /** * Extracts collinear coordinates from SVG path straight lines * (does not extracts collinear coordinates from curves). @@ -336,7 +336,7 @@ module.exports = { let seg = segments[s], cmd = seg[0], nextCmd = s + 1 < segments.length ? segments[s + 1][0] : null; - + if ('LM'.includes(cmd)) { currAbsCoord[0] = seg[1]; currAbsCoord[1] = seg[2]; @@ -368,7 +368,7 @@ module.exports = { currAbsCoord = [startPoint[0], startPoint[1]]; _resetStartPoint = true; } else { - throw new Error(`"${cmd}" command not handled`) + throw new Error(`"${cmd}" command not handled`); } if (startPoint === undefined) { @@ -396,7 +396,7 @@ module.exports = { currLine[p][0], currLine[p][1], currLine[p + 1][0], - currLine[p + 1][1]) + currLine[p + 1][1]); if (_collinearCoord) { collinearSegments.push(segments[s - currLine.length + p + 1]); } @@ -405,7 +405,7 @@ module.exports = { currLine = []; } } - + return collinearSegments; } diff --git a/Gemfile.lock b/Gemfile.lock index 30d36dc8eb7c..8a1b1f6c4a71 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -65,4 +65,4 @@ DEPENDENCIES jekyll (= 4.2) BUNDLED WITH - 2.2.0 + 2.2.0 diff --git a/LICENSE.md b/LICENSE.md index 7f23e0dcf535..da5b887934e1 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -9,13 +9,13 @@ Certain owners wish to permanently relinquish those rights to a Work for the pur For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the “Affirmer”), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights (“Copyright and Related Rights”). Copyright and Related Rights include, but are not limited to, the following: - 1. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; - 2. moral rights retained by the original author(s) and/or performer(s); - 3. publicity and privacy rights pertaining to a person’s image or likeness depicted in a Work; - 4. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(i), below; - 5. rights protecting the extraction, dissemination, use and reuse of data in a Work; - 6. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and - 7. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. + 1. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; + 2. moral rights retained by the original author(s) and/or performer(s); + 3. publicity and privacy rights pertaining to a person’s image or likeness depicted in a Work; + 4. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(i), below; + 5. rights protecting the extraction, dissemination, use and reuse of data in a Work; + 6. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and + 7. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. 2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the “Waiver”). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer’s heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer’s express Statement of Purpose. diff --git a/_config.yml b/_config.yml index 911646d769c3..3007b266ba2c 100644 --- a/_config.yml +++ b/_config.yml @@ -1,10 +1,10 @@ exclude: -- tests -- scripts -- composer.json -- CONTRIBUTING.md -- Dockerfile -- index.js -- package-lock.json -- package.json -- README.md + - tests + - scripts + - composer.json + - CONTRIBUTING.md + - Dockerfile + - index.js + - package-lock.json + - package.json + - README.md diff --git a/index.html b/index.html index 50a7a47d43aa..db2b9b07370d 100644 --- a/index.html +++ b/index.html @@ -185,15 +185,15 @@ diff --git a/package.json b/package.json index 3340fe62f3fc..ecf51e819be6 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ }, "scripts": { "build": "node scripts/build-package.js", - "clean": "rm icons/*.js index.js", + "clean": "rm -f icons/*.js index.js", "lint": "run-s our-lint jsonlint svglint wslint", "our-lint": "node scripts/lint.js", "jsonlint": "jsonlint _data/simple-icons.json -q -V .jsonlintschema", diff --git a/scripts/lint.js b/scripts/lint.js index a9833b4a1791..0613efe1fa4e 100644 --- a/scripts/lint.js +++ b/scripts/lint.js @@ -2,7 +2,7 @@ /** * @fileoverview Lints for the package that can't be implemented in the existing linters (e.g. jsonlint/svglint) */ - + const fs = require("fs"); const path = require("path"); diff --git a/scripts/templates/index.js b/scripts/templates/index.js index 18823bb4d838..cd0370c799cb 100644 --- a/scripts/templates/index.js +++ b/scripts/templates/index.js @@ -10,7 +10,7 @@ Object.defineProperty(icons, "get", { for (var iconName in icons) { var icon = icons[iconName]; if (icon.title.toLowerCase() === normalizedName || icon.slug === normalizedName) { - return icon; + return icon; } } }