-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow to put custom attributes
Signed-off-by: Florian BOUILLON <[email protected]>
- Loading branch information
1 parent
9572b3b
commit fbe4d7b
Showing
6 changed files
with
64 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,47 +5,47 @@ | |
name: Build & Package | ||
|
||
on: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: '0 */6 * * *' | ||
workflow_dispatch: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
- cron: '0 */6 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Upgrade | ||
id: upgrade | ||
run: node upgrade.js | ||
continue-on-error: true | ||
- name: Install | ||
run: npm i | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
- name: Build | ||
run: npm run build | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
- name: Publish on NPM | ||
run: npm publish | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Dzeio BOT" | ||
git commit -a -m "bump from remote" | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GIT_TOKEN }} | ||
branch: ${{ github.ref }} | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Upgrade | ||
id: upgrade | ||
run: node upgrade.js | ||
continue-on-error: true | ||
- name: Install | ||
run: npm i | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
- name: Build | ||
run: npm run build | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
- name: Publish on NPM | ||
run: npm publish | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Dzeio BOT" | ||
git commit -a -m "bump from remote" | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GIT_TOKEN }} | ||
branch: ${{ github.ref }} | ||
if: steps.upgrade.outcome == 'success' && steps.upgrade.conclusion == 'success' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,21 @@ | ||
--- | ||
import type { Props as IconProps } from './index.d.ts' | ||
export type { Props } from './index.d.ts' | ||
export interface Props extends IconProps {} | ||
const { | ||
size = 24, | ||
strokeWidth = 2, | ||
width = size, | ||
height = size, | ||
stroke = 'currentColor', | ||
strokeLinecap = 'round', | ||
strokeLinejoin = 'round', | ||
fill = 'none', | ||
viewBox = '0 0 24 24' | ||
} = (Astro.props ?? {}) | ||
const size = Astro.props.size | ||
delete Astro.props.size | ||
--- | ||
|
||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class={Astro.props.class} | ||
width={width} | ||
height={height} | ||
fill={fill} | ||
viewBox={viewBox} | ||
stroke={stroke} | ||
stroke-width={strokeWidth} | ||
stroke-linecap={strokeLinecap} | ||
stroke-linejoin={strokeLinejoin} | ||
stroke-width={2} | ||
width={size ?? 24} | ||
height={size ?? 24} | ||
stroke="currentColor" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
{...Astro.props} | ||
> | ||
<slot /> | ||
</svg> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
export interface Props { | ||
/// <reference types="astro/astro-jsx" /> | ||
|
||
export interface Props extends astroHTML.JSX.SVGAttributes { | ||
size?: number | ||
// https://github.com/withastro/astro/pull/8189 | ||
width?: number | ||
height?: number | ||
strokeWidth?: number | ||
stroke?: string | ||
fill?: string | ||
class?: string | ||
viewBox?: string | ||
strokeLinecap?: "round" | "butt" | "square" | "inherit" | ||
strokeLinejoin?: "round" | "inherit" | "miter" | "bevel" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters