diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2403cee42..53e3d2912 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,16 +1,18 @@ + + - -## What is the purpose of this pull request? - -- [ ] New Icon -- [ ] Bug fix -- [ ] New Feature -- [ ] Documentation update -- [ ] Other: - -### Description +## Description ### Icon use case diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f228da9b..d37da8f74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: jobs: create-release: - if: github.repository == 'lucide-icons/lucide' && ${{ !startsWith(github.event.head_commit.message, 'fix(icons)') }} + if: github.repository == 'lucide-icons/lucide' && startsWith(github.event.head_commit.message, 'feat(icons)') runs-on: ubuntu-latest outputs: VERSION: ${{ steps.new-version.outputs.NEW_VERSION }} diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index 51b77fb93..2f4206001 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -2,6 +2,8 @@ name: Linting PR on: pull_request: + paths-ignore: + - icons/*.svg jobs: lint-code: diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml index 67a095027..d5f7ce8a3 100644 --- a/.github/workflows/lint-pr-title.yml +++ b/.github/workflows/lint-pr-title.yml @@ -5,7 +5,6 @@ on: types: - opened - edited - - synchronize - reopened jobs: @@ -27,6 +26,7 @@ jobs: docs ci build + chore requireScope: true ignoreLabels: | bot diff --git a/.github/workflows/linting-icons.yml b/.github/workflows/linting-icons.yml index dabecbd93..d768ff1b1 100644 --- a/.github/workflows/linting-icons.yml +++ b/.github/workflows/linting-icons.yml @@ -25,48 +25,6 @@ jobs: env: CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - lint-contributors: - name: Lint Contributors - if: github.repository == 'lucide-icons/lucide' - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v4 - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v46 - with: - files: icons/* - - - uses: actions/setup-node@v4 - with: - node-version-file: 'package.json' - - name: Install simple-git (safer and faster than installing all deps) - run: npm install simple-git - - - name: Generate annotations - run: node ./scripts/updateContributors.mjs - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FETCH_DEPTH: ${{ github.event.pull_request.commits }} - CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - - - name: Generate annotations - env: - ANNOTATION_SEVERITY: notice - ANNOTATION_TITLE: Contributors have changed! - ANNOTATION_DESCRIPTION: Don't add people who have only performed automatic optimizations. - run: | - git diff --unified=0 -- icons/*.json | # diff icon metadata (unified=0 gives the correct chunk line number) - perl -ne '/^(\+|- |@)/ && print' | # get chunks (lines that start with "+++", "@@", "+ ", "- ") - perl -pe 's/\n/%0A/' | # url encode line breaks (\n -> %0A) - perl -pe 's/%0A(\+\+\+ b\/)/\n\1/g' | # split chunks(one chunk per line) - perl -pe "s/\+\+\+ b\/([^@]*)%0A@@ -(\d+)[^\s]* \+(\d+)[^@]*@@(.*)/::$ANNOTATION_SEVERITY file=\1,line=\2,endLine=\3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A\4/" - # Example for the previous substitution - # input: +++ b/icons/accessibility.json%0A@@ -2,0 +3 @@%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A - # output: ::$ANNOTATION_SEVERITY file=icons/accessibility.json,line=2,endLine=3,title=$ANNOTATION_TITLE::$ANNOTATION_DESCRIPTION%0A%0A+ "contributors": ["hi"],%0A@@ -13 +14 @@%0A+}%0A - lint-aliases: name: Check Uniqueness of Aliases runs-on: ubuntu-latest diff --git a/.github/workflows/lucide-font.yml b/.github/workflows/lucide-font.yml index 32a9e947a..2f2ccbf54 100644 --- a/.github/workflows/lucide-font.yml +++ b/.github/workflows/lucide-font.yml @@ -3,7 +3,6 @@ name: Lucide font checks on: pull_request: paths: - - icons/** - tools/build-font/** - pnpm-lock.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f35b3e358..f1594ce73 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,8 @@ jobs: if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest needs: pre-release + permissions: + id-token: write strategy: fail-fast: false matrix: @@ -80,11 +82,15 @@ jobs: - name: Publish run: pnpm --filter ${{ matrix.package }} publish --access public --no-git-checks --ignore-scripts + env: + NPM_CONFIG_PROVENANCE: true lucide-static: if: github.repository == 'lucide-icons/lucide' runs-on: ubuntu-latest needs: [pre-release, lucide-font] + permissions: + id-token: write steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 @@ -111,6 +117,8 @@ jobs: - name: Publish run: pnpm --filter lucide-static publish --no-git-checks + env: + NPM_CONFIG_PROVENANCE: true lucide-font: if: github.repository == 'lucide-icons/lucide' diff --git a/.github/workflows/request-review.yml b/.github/workflows/request-review.yml new file mode 100644 index 000000000..f35214e38 --- /dev/null +++ b/.github/workflows/request-review.yml @@ -0,0 +1,32 @@ +name: 'Request Review' +on: + pull_request_target: + types: [opened] + paths: icons/*.svg + +jobs: + request-review: + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: refs/pull/${{ github.event.pull_request.number }}/merge + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v41 + with: + files: icons/*.svg + - run: | + while IFS= read -r file; do + jq -r '.contributors[]' "${file%.svg}.json" + done <<< "$CHANGED_FILES" | while read -r contributor; do + gh pr edit "${{ github.event.pull_request.number }}" --add-reviewer "$contributor" || true + done + env: + GH_TOKEN: ${{ github.token }} + CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45a7ff58a..286341283 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,10 +16,10 @@ Guidelines for pull requests: - __Make your commit messages as descriptive as possible.__ Include as much information as you can. Explain anything that the file diffs themselves won’t make apparent. - __Document your pull request__. Explain your fix, link to the relevant issue, add screenshots when adding new icons. -- __Make sure the target of your pull request is the relevant branch__. Most of bugfix or new feature should go to the `main` branch. -- __Include only related work__. If your pull request has unrelated commit, it won't be accepted. +- __Make sure the target of your pull request is the relevant branch__. Most of bug fixes or new feature should go to the `main` branch. +- __Include only related work__. If your pull request has unrelated commits, it won't be accepted. -### Pull Requests Including Icons +### Icon Pull Requests #### Guidelines @@ -27,26 +27,30 @@ Please make sure you follow the icon guidelines, that should be followed to keep Read it here: [ICON_GUIDELINES](https://lucide.dev/docs/icon-design-guide). -### Editor guides +#### Lucide Studio + +For formatting and adjusting SVG icons, [@jguddas](https://github.com/jguddas) made a great tool called [Lucide Studio](https://studio.lucide.dev/). It is a web-based SVG editor that allows you to edit and adjust icons in the Lucide style. You can use it to create new icons or modify existing ones. + +#### Editor guides Here you can find instructions on how to implement the guidelines with different vector graphics editors: -#### [Adobe Illustrator Guide](https://lucide.dev/docs/illustrator-guide) +##### [Adobe Illustrator Guide](https://lucide.dev/docs/illustrator-guide) You can also [download an Adobe Illustrator template](https://github.com/lucide-icons/lucide/blob/main/docs/public/templates/illustrator_template.ai). -#### [Inkscape Guide](https://lucide.dev/docs/inkscape-guide) +##### [Inkscape Guide](https://lucide.dev/docs/inkscape-guide) -#### [Figma Guide](https://lucide.dev/docs/figma-guide) +##### [Figma Guide](https://lucide.dev/docs/figma-guide) -#### [Affinity Designer Guide](https://lucide.dev/guide/design/affinity-designer-guide) +##### [Affinity Designer Guide](https://lucide.dev/guide/design/affinity-designer-guide) -### Submitting Multiple Icons +#### Submitting Multiple Icons -If you want submit multiple icons, please separate the icons and group them. That makes reviewing the icons easier and keep the thread clean and scoped. -So don't submit multiple icons in one PR that have noting to do with each other. +If you want to submit multiple icons, please separate the icons and group them. That makes reviewing the icons easier and keeps the thread clean and scoped. +So don't submit multiple icons in one PR that have nothing to do with each other. So for example don't create one PR with icons: `arrow-up`, `bicycle`, `arrow-down`. -Seperate them by two PRs; 'pr-01' `arrow`, `arrow-down` and 'pr-02' `bicycle`. +Separate them into two PRs; 'pr-01' `arrow`, `arrow-down` and 'pr-02' `bicycle`. ## Icon Requests @@ -127,7 +131,7 @@ When adding new features to for example the icon component for a framework. It i ### Local Testing -To test changes in a local project, you can use `yarn link`, `npm link`, `bun link` or `pnpm link` to link the package. Before you do this make sure you builded the package first. +To test changes in a local project, you can use `yarn link`, `npm link`, `bun link` or `pnpm link` to link the package. Before you do this make sure you've built the package first. ```sh # in packages/lucide-react @@ -173,7 +177,7 @@ Includes all the (npm) packages of lucide. ### Scripts -Includes usefully scripts to automate certain jobs. Big part of the scripts is the template generation, for example it generates icon components for all the packages. These scripts are usually executed from the "scripts" section in the package.json. +Includes useful scripts to automate certain jobs. Big part of the scripts is the template generation, for example it generates icon components for all the packages. These scripts are usually executed from the "scripts" section in the package.json. ## Documentation diff --git a/docs/.vitepress/data/packageData.json b/docs/.vitepress/data/packageData.json index dc9d24a6b..6ad333133 100644 --- a/docs/.vitepress/data/packageData.json +++ b/docs/.vitepress/data/packageData.json @@ -137,7 +137,7 @@ { "alt": "npm", "src": "https://img.shields.io/npm/v/@lucide/astro", - "href": "https://www.npmjs.com/package/@luclide/astro" + "href": "https://www.npmjs.com/package/@lucide/astro" }, { "alt": "npm", diff --git a/docs/.vitepress/data/packageData.thirdParty.json b/docs/.vitepress/data/packageData.thirdParty.json index f167085fe..dd9650730 100644 --- a/docs/.vitepress/data/packageData.thirdParty.json +++ b/docs/.vitepress/data/packageData.thirdParty.json @@ -79,7 +79,7 @@ }, { "name": "lucide-lustre", - "description": "A library providing https://lucide.dev icons to lustre", + "description": "A library providing https://lucide.dev icons to lustre.", "icon": "/framework-logos/lustre.webp", "shields": [ { diff --git a/docs/.vitepress/theme/components/base/Switch.vue b/docs/.vitepress/theme/components/base/Switch.vue index c327fcf9a..2af40f7a4 100644 --- a/docs/.vitepress/theme/components/base/Switch.vue +++ b/docs/.vitepress/theme/components/base/Switch.vue @@ -3,11 +3,13 @@ import { Switch } from '@headlessui/vue' const enabled = ref(false) +