Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add lucide package for Astro #2665

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
13ff430
feat(lucide-astro): initial commit
MoustaphaDev Dec 2, 2024
f9fe187
test: add test suite
MoustaphaDev Dec 5, 2024
b9bad41
fix module resolution issue
MoustaphaDev Dec 5, 2024
b357b58
chore: update lock file
MoustaphaDev Dec 5, 2024
e37152b
chore: update lock file
MoustaphaDev Dec 5, 2024
7cb398e
chore: resolve merge conflict
MoustaphaDev Dec 5, 2024
bd6209a
chore: fix precommit hook failing
MoustaphaDev Dec 5, 2024
8f7e3a3
sync icons generated by precommit hook
MoustaphaDev Dec 5, 2024
b457655
remove useless tab in template
MoustaphaDev Dec 5, 2024
7782e89
style: add space for readability
MoustaphaDev Dec 5, 2024
97a1ecf
docs: add bun installation instructions
MoustaphaDev Dec 5, 2024
7e8ca44
fix `clean` script
MoustaphaDev Dec 5, 2024
40723e9
fix testing setup
MoustaphaDev Dec 6, 2024
e915a7e
remove unnecessary `key` props in Astro icons
MoustaphaDev Dec 6, 2024
822b3c3
fix jest matchers types and undefined behavior
MoustaphaDev Dec 6, 2024
d401c5a
chore: update lock file
MoustaphaDev Dec 6, 2024
6c6ff1c
setup prettier for formatting Astro files
MoustaphaDev Dec 6, 2024
6dd7abb
remove mistakenly added prop from the `Icon` component
MoustaphaDev Dec 6, 2024
ddc6647
docs: add documentation for new Astro package
MoustaphaDev Dec 6, 2024
e1c12ad
fix incorrect types in `Icon` component
MoustaphaDev Dec 7, 2024
0edb59b
refactor: use `stroke-width` over `strokeWidth`
MoustaphaDev Dec 7, 2024
ca9e810
fix unexpected module resolution behavior
MoustaphaDev Dec 7, 2024
3fb7936
remove hack in test types
MoustaphaDev Dec 7, 2024
671229d
remove review marker
MoustaphaDev Dec 7, 2024
32e4af7
docs: progress on documentation of lucide-astro
MoustaphaDev Dec 7, 2024
2cd76a6
chore: remove unnecessary .gitignore
MoustaphaDev Dec 7, 2024
e21a563
docs: add sidebar entry
MoustaphaDev Dec 7, 2024
e6b7410
edit package description
MoustaphaDev Dec 7, 2024
a8fe771
fix uneven icon heights in homepage packages list
MoustaphaDev Dec 7, 2024
b772a23
docs: add package to readme table
MoustaphaDev Dec 7, 2024
21d9f62
add workflows for lucide-astro package
MoustaphaDev Dec 7, 2024
9047381
docs: add package-logos
MoustaphaDev Dec 8, 2024
8c1356e
use the appropriate Astro logo in light and dark mode
MoustaphaDev Dec 8, 2024
6a57cd2
Remove inadvertently added class
MoustaphaDev Dec 18, 2024
7ceb437
Update snapshots to reflect removed class `lucide-icon`
MoustaphaDev Dec 18, 2024
27a6168
remove dependency on internal `@lucide/shared` package
MoustaphaDev Dec 19, 2024
0a3d0e8
fix: revert changes
realguse Dec 22, 2024
72bdced
revert grid-2x2-x.json
realguse Dec 22, 2024
4930b74
revert grid-2x2-check.json
realguse Dec 22, 2024
2ff7f34
revert picture-in-picture svg
realguse Dec 22, 2024
c5934bd
add package in labeler workflow
MoustaphaDev Dec 24, 2024
497bf34
Merge pull request #1 from realguse/revert-icons
MoustaphaDev Dec 24, 2024
6997973
Merge branch 'main' of https://github.com/lucide-icons/lucide into fe…
MoustaphaDev Dec 24, 2024
320fe96
add previously uncommited utils.ts file
MoustaphaDev Dec 24, 2024
141c331
fix dom type errors
MoustaphaDev Dec 25, 2024
74432e7
up one major from legacy package
MoustaphaDev Dec 26, 2024
d0e6623
add package to issue and feature request templates
MoustaphaDev Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/02_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ body:
- label: lucide-svelte
- label: lucide-vue
- label: lucide-vue-next
- label: lucide-astro
- label: Figma plugin
- label: source/main
- label: other/not relevant
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/04_feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ body:
- label: lucide-svelte
- label: lucide-vue
- label: lucide-vue-next
- label: lucide-astro
- label: Figma plugin
- label: all JS packages
- label: site
Expand Down
6 changes: 6 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@
- any-glob-to-any-file:
- 'packages/lucide-solid/*'

# For changes in the lucide astro package
🚀 astro package:
- changed-files:
- any-glob-to-any-file:
- 'packages/lucide-astro/*'

# For changes in the lucide static package
🪨 static package:
- changed-files:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/lucide-astro.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lucide Astro Checks

on:
pull_request:
paths:
- packages/lucide-astro/**
- packages/shared/**
- tools/build-icons/**
- pnpm-lock.yaml

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm --filter lucide-astro build

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3.8.1
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Test
run: pnpm --filter lucide-astro test
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
'lucide-preact',
'lucide-solid',
'lucide-svelte',
'lucide-astro'
]
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Lucide is an open-source icon library that provides 1000+ vector (svg) files for
| <img src="https://lucide.dev/framework-logos/preact.svg" alt="Preact logo" width="48"> | `lucide-preact` | [![npm](https://img.shields.io/npm/v/lucide-preact)](https://www.npmjs.com/package/lucide-preact) ![NPM Downloads](https://img.shields.io/npm/dw/lucide-preact) | [Docs](https://lucide.dev/guide/packages/lucide-preact) [Source](./packages/lucide-preact) |
| <img src="https://lucide.dev/framework-logos/react-native.svg" alt="React Native logo" width="48"> | `lucide-react-native` | [![npm](https://img.shields.io/npm/v/lucide-react-native)](https://www.npmjs.com/package/lucide-react-native) ![NPM Downloads](https://img.shields.io/npm/dw/lucide-react-native) | [Docs](https://lucide.dev/guide/packages/lucide-react-native) [Source](./packages/lucide-react-native) |
| <img src="https://lucide.dev/framework-logos/angular.svg" alt="Angular logo" width="48"> | `lucide-angular` | [![npm](https://img.shields.io/npm/v/lucide-angular)](https://www.npmjs.com/package/lucide-angular) ![NPM Downloads](https://img.shields.io/npm/dw/lucide-angular) | [Docs](https://lucide.dev/guide/packages/lucide-angular) [Source](./packages/lucide-angular) |
| <img src="https://lucide.dev/framework-logos/astro.svg" alt="Astro logo" width="48"> | `lucide-astro` | [![npm](https://img.shields.io/npm/v/lucide-astro)](https://www.npmjs.com/package/lucide-astro) ![NPM Downloads](https://img.shields.io/npm/dw/lucide-astro) | [Docs](https://lucide.dev/guide/packages/lucide-astro) [Source](./packages/lucide-astro) |
| <img src="https://lucide.dev/framework-logos/svg.svg" alt="SVG logo" width="48"> | `lucide-static` | [![npm](https://img.shields.io/npm/v/lucide-static)](https://www.npmjs.com/package/lucide-static) ![NPM Downloads](https://img.shields.io/npm/dw/lucide-static) | [Docs](https://lucide.dev/guide/packages/lucide-static) [Source](./packages/lucide-static) |

### Figma
Expand Down
19 changes: 18 additions & 1 deletion docs/.vitepress/data/packageData.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,25 @@
}
]
},
"lucide-static": {
"lucide-astro": {
"order": 8,
"icon": "astro",
"iconDark": "astro-dark",
"shields": [
{
"alt": "npm",
"src": "https://img.shields.io/npm/v/lucide-astro",
"href": "https://www.npmjs.com/package/lucide-astro"
},
{
"alt": "npm",
"src": "https://img.shields.io/npm/dw/lucide-astro",
"href": "https://www.npmjs.com/package/lucide-astro"
}
]
},
"lucide-static": {
"order": 9,
"icon": "svg",
"shields": [
{
Expand Down
4 changes: 4 additions & 0 deletions docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ const sidebar: UserConfig<DefaultTheme.Config>['themeConfig']['sidebar'] = {
text: 'Lucide Preact',
link: '/guide/packages/lucide-preact',
},
{
text: 'Lucide Astro',
link: '/guide/packages/lucide-astro',
},
{
text: 'Lucide Static',
link: '/guide/packages/lucide-static',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ export default {
logo: '/framework-logos/angular.svg',
label: 'Lucide documentation for Angular',
},
{
name: 'lucide-astro',
logo: '/framework-logos/astro.svg',
logoDark: '/framework-logos/astro-dark.svg',
label: 'Lucide documentation for Astro',
},
{
name: 'lucide-react-native',
logo: '/framework-logos/react-native.svg',
Expand Down
27 changes: 24 additions & 3 deletions docs/.vitepress/theme/components/home/HomePackagesSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,25 @@ const { go } = useRouter()
<HomeSectionTitle>Available For:</HomeSectionTitle>
<div class="packages-list">
<a
v-for="{ name, logo } in data.packages"
v-for="{ name, logo, logoDark } in data.packages"
:href="`/guide/packages/${name}`"
class="package-logo"
:aria-label="`Read more about: ${name} package`"
@click.prevent="go(`/guide/packages/${name}`)"
>
<img
:src="logo"
height="36"
width="36"
:class="{ light: logoDark, 'image-logo': true }"
:alt="`${name} logo`"
loading="lazy"
/>

<img
v-if="logoDark"
:src="logoDark"
:alt="`${name} logo`"
class="image-logo dark"
loading="lazy"
/>
</a>
</div>
Expand All @@ -35,6 +42,13 @@ const { go } = useRouter()
</template>

<style scoped>

.image-logo {
object-fit: contain;
width: 36px;
height: 36px;
}

.packages-list {
display: flex;
flex-wrap: wrap;
Expand All @@ -57,4 +71,11 @@ const { go } = useRouter()
.package-logo:hover {
opacity: .6;
}

html.dark .image-logo.light {
display: none;
}
html:not(.dark) .image-logo.dark {
display: none;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
documentation: `/guide/packages/${pData.name}`,
source: `https://github.com/lucide-icons/lucide/tree/main/packages/${pData.name}`,
icon: `/framework-logos/${packageData[pData.name].icon}.svg`,
iconDark: Boolean(packageData[pData.name].iconDark) ? `/framework-logos/${packageData[pData.name].iconDark}.svg` : null
}))
.sort((a, b) => a.order - b.order),
thirdPartyPackages,
Expand Down
3 changes: 2 additions & 1 deletion docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ However, not everyone can understand them easily. Read more about [how to use Lu

## Official Packages

Lucide's official packages are designed to work on different platforms, making it easier for users to integrate icons into their projects. The packages are available for various technologies, including [Web (Vanilla)](https://lucide.dev/guide/packages/lucide), [React](https://lucide.dev/guide/packages/lucide-react), [React Native](https://lucide.dev/guide/packages/lucide-react-native), [Vue](https://lucide.dev/guide/packages/lucide-vue), [Vue 3](https://lucide.dev/guide/packages/lucide-vue-next), [Svelte](https://lucide.dev/guide/packages/lucide-svelte), [Preact](https://lucide.dev/guide/packages/lucide-preact), [Solid](https://lucide.dev/guide/packages/lucide-solid), [Angular](https://lucide.dev/guide/packages/lucide-angular), [NodeJS](https://lucide.dev/guide/packages/lucide-static#nodejs) and [Flutter](https://lucide.dev/guide/packages/lucide-flutter).
Lucide's official packages are designed to work on different platforms, making it easier for users to integrate icons into their projects. The packages are available for various technologies, including [Web (Vanilla)](https://lucide.dev/guide/packages/lucide), [React](https://lucide.dev/guide/packages/lucide-react), [React Native](https://lucide.dev/guide/packages/lucide-react-native), [Vue](https://lucide.dev/guide/packages/lucide-vue), [Vue 3](https://lucide.dev/guide/packages/lucide-vue-next), [Svelte](https://lucide.dev/guide/packages/lucide-svelte), [Preact](https://lucide.dev/guide/packages/lucide-preact), [Solid](https://lucide.dev/guide/packages/lucide-solid), [Angular](https://lucide.dev/guide/packages/lucide-angular), [Astro](https://lucide.dev/guide/packages/lucide-astro), [NodeJS](https://lucide.dev/guide/packages/lucide-static#nodejs) and [Flutter](https://lucide.dev/guide/packages/lucide-flutter).

## Community

If you have any questions about Lucide, feel free to reach out to the community. You can find them on [GitHub](https://github.com/lucide-icons/lucide) and [Discord](https://discord.gg/EH6nSts).
26 changes: 26 additions & 0 deletions docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,32 @@ bun add lucide-preact

:::

## Astro

Implementation of the lucide icon library for Astro applications.

::: code-group

```sh [pnpm]
pnpm install lucide-astro
```

```sh [yarn]
yarn add lucide-astro
```

```sh [npm]
npm install lucide-astro
```

```sh [bun]
bun add lucide-astro
```

:::

For more details, see the [documentation](packages/lucide-astro.md).

## Static usage

Implementation of the lucide icon library for multiple usages that like to use: SVG files icons, SVG Sprite, Icon Fonts and static SVG strings export in Common JS modules (for NodeJS).
Expand Down
Loading
Loading