Skip to content

Commit

Permalink
chore: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
HoPGoldy committed Dec 5, 2024
1 parent 723655c commit 272ea8a
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 10 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release

on:
push:
tags:
- '*'

jobs:
build-publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 15 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
build
npm-debug.log
yarn-debug.log
yarn-error.log
.idea
.vscode
.DS_Store
.env
*.local
*.log
*.lock
coverage
*.tsbuildinfo
assert/**/*
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ export default function App() {

### 1. 基本配置

| 参数 | 类型 | 必填 | 默认值 | 说明 |
| ---------- | --------------------------- | ---- | ------- | ------------------------------------------------------------- |
| colors | `string[]` || | 背景色配置,会随机从中选取对应的颜色 |
| items | `BlurryGradientItemProps[]` || | 精确控制每个色块的配置,当该属性有值时,`colors` 参数将被忽略 |
| blur | `string` || `100px` | 模糊程度,为 0 则完全不模糊 |
| itemNumber | `number` || `10` | 渐变色块的数量 |
| 参数 | 类型 | 必填 | 默认值 | 说明 |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------- | ---- | ------- | ------------------------------------------------------------- |
| colors | `string[]` || | 背景色配置,会随机从中选取对应的颜色 |
| items | [`BlurryGradientItemProps[]`](https://github.com/HoPGoldy/react-blurry-gradient/blob/master/src/blurry-gradient/types.ts#L82) || | 精确控制每个色块的配置,当该属性有值时,`colors` 参数将被忽略 |
| blur | `string` || `100px` | 模糊程度,为 0 则完全不模糊 |
| itemNumber | `number` || `10` | 渐变色块的数量 |

### 2. 随机范围配置

Expand Down
33 changes: 29 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"name": "react-blurry-gradient",
"private": true,
"description": "A React component that creates blurry gradient effect.",
"private": false,
"version": "1.0.0",
"homepage": "https://github.com/HoPGoldy/react-blurry-gradient",
"repository": {
"type": "git",
"url": "https://github.com/HoPGoldy/react-blurry-gradient"
},
"type": "module",
"main": "./dist/react-blurry-gradient.js",
"module": "./dist/react-blurry-gradient.js",
Expand All @@ -20,11 +26,21 @@
]
}
},
"files": [
"dist/*"
],
"engines": {
"node": ">=16"
},
"scripts": {
"dev": "vite --host --port=3000",
"build": "tsc -b && vite build",
"lint": "eslint ."
},
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.15.0",
"@types/node": "^22.10.1",
Expand All @@ -38,11 +54,20 @@
"eslint-plugin-react-refresh": "^0.4.14",
"globals": "^15.12.0",
"prettier": "^3.4.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"typescript": "~5.6.2",
"typescript-eslint": "^8.15.0",
"vite": "^6.0.1",
"vite-plugin-dts": "^4.3.0"
}
},
"author": {
"name": "HoPGoldy",
"email": "[email protected]"
},
"keywords": [
"react",
"gradient",
"css",
"blurry gradient"
],
"license": "MIT"
}

0 comments on commit 272ea8a

Please sign in to comment.